diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-10-19 03:17:48 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-10-25 04:38:07 +0300 |
commit | bffdf9d7e51a7be8eeaac2ccf9e54a5fde01ff65 (patch) | |
tree | 1564ea5cedcb5f5d5e425a81381762d6ed88fbb6 /tools/perf/scripts/python/intel-pt-events.py | |
parent | 2de01e0e57f3ebe7f90b08f6bca5ce0f3da3829f (diff) | |
download | linux-bffdf9d7e51a7be8eeaac2ccf9e54a5fde01ff65.tar.xz |
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 <lizetao1@huawei.com>
Fixes: 9dfd9708ffba ("Input: edt-ft5x06 - convert to use regmap API")
Cc: stable@vger.kernel.org
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/ZxL6rIlVlgsAu-Jv@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/intel-pt-events.py')
0 files changed, 0 insertions, 0 deletions