diff options
author | Dmitry Torokhov <[email protected]> | 2024-10-18 17:17:48 -0700 |
---|---|---|
committer | Dmitry Torokhov <[email protected]> | 2024-10-24 18:38:07 -0700 |
commit | bffdf9d7e51a7be8eeaac2ccf9e54a5fde01ff65 (patch) | |
tree | 1564ea5cedcb5f5d5e425a81381762d6ed88fbb6 /scripts/gdb/linux/modules.py | |
parent | 2de01e0e57f3ebe7f90b08f6bca5ce0f3da3829f (diff) |
Input: edt-ft5x06 - fix regmap leak when probe fails
The driver neglects to free the instance of I2C regmap constructed at
the beginning of the edt_ft5x06_ts_probe() method when probe fails.
Additionally edt_ft5x06_ts_remove() is freeing the regmap too early,
before the rest of the device resources that are managed by devm are
released.
Fix this by installing a custom devm action that will ensure that the
regmap is released at the right time during normal teardown as well as
in case of probe failure.
Note that devm_regmap_init_i2c() could not be used because the driver
may replace the original regmap with a regmap specific for M06 devices
in the middle of the probe, and using devm_regmap_init_i2c() would
result in releasing the M06 regmap too early.
Reported-by: Li Zetao <[email protected]>
Fixes: 9dfd9708ffba ("Input: edt-ft5x06 - convert to use regmap API")
Cc: [email protected]
Reviewed-by: Oliver Graute <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/modules.py')
0 files changed, 0 insertions, 0 deletions