]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: meson-saradc: fix calibration buffer leak on error
authorFelix Gu <ustc.gu@gmail.com>
Mon, 27 Apr 2026 11:26:31 +0000 (19:26 +0800)
committerJonathan Cameron <jic23@kernel.org>
Fri, 15 May 2026 11:05:34 +0000 (12:05 +0100)
commitba121d7582361fe74405f32724976aeff5c35177
tree32eae538a1ade057be5114b82a44241ebbfaa9d7
parentd0a228d903425e653f18a4341e60c0538afb6d41
iio: adc: meson-saradc: fix calibration buffer leak on error

meson_sar_adc_temp_sensor_init() allocates a buffer with
nvmem_cell_read(), but the old code leaked it if
syscon_regmap_lookup_by_phandle() failed.

Fix this by adding missing kfree(buf).

Fixes: d6f2eac64403 ("iio: adc: meson: no devm for nvmem_cell_get")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/meson_saradc.c