Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: adc: meson-saradc: check for devm_kasprintf failure
devm_kasprintf() may return NULL on failure of internal allocation thus the assignments to init.name are not safe if not checked. On error meson_sar_adc_clk_init() returns negative values so -ENOMEM in the (unlikely) failure case of devm_kasprintf() should be fine here. Signed-off-by: Nicholas Mc Guire <[email protected]> Fixes: 3adbf34 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Acked-by: Martin Blumenstingl <[email protected]> Tested-by: Martin Blumenstingl <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
- Loading branch information