Re: [PATCH] iio: adc: meson-saradc: fix calibration buffer leak on error

From: Andy Shevchenko

Date: Mon Apr 27 2026 - 03:45:11 EST


On Sun, Apr 26, 2026 at 12:07:24AM +0800, Felix Gu wrote:
> 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.

> Switch buf to __free(kfree) so all return paths release it.

__free() is defined in cleanup.h which is missing in the driver. Please add the
include to it.

--
With Best Regards,
Andy Shevchenko