diff options
| author | Matti Vaittinen <mazziesaccount@gmail.com> | 2026-09-02 11:49:05 +0300 |
|---|---|---|
| committer | Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> | 2026-09-06 22:36:00 +0100 |
| commit | e65e128b51a37dd1a9056ac3d1705d805a5c8bb0 (patch) | |
| tree | a805e34698b9c71e579917c0a72c912dc6e8ffa2 /tools/lib/python | |
| parent | 8065a6c02f629187131f3136bedb26f9080e3cca (diff) | |
| download | linux-next-e65e128b51a37dd1a9056ac3d1705d805a5c8bb0.tar.gz linux-next-e65e128b51a37dd1a9056ac3d1705d805a5c8bb0.zip | |
iio: accel: kionix-kx022a: Prevent memory leak and fix state
The driver allocates memory for samples at buffer enable path. If regmap
operation fails in the kx022a_fifo_enable() at the buffer enable path, the
allocated memory is never freed. Furthermore, the state information and
previous hardware configuration(s) aren't undone, potentially leaving
WMI interrupts and buffers enabled, or driver state flags wrong.
Free the memory and revert the hardware configuration and state flags on
error path.
Fixes: e7123a4dfcd7 ("iio: accel: kionix-kx022a: Refactor driver and add chip_info structure")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
