summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-10-30 17:19:18 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-01 15:54:47 +0100
commit8ebfd09255219ae55f8a101f6aeb0f64dd780d88 (patch)
tree01e5d524c4983400bd21c1a3481be40d4598e5e9 /drivers/iio
parentiio: imu: bmi270: Add support for BMI260 (diff)
downloadlinux-8ebfd09255219ae55f8a101f6aeb0f64dd780d88.tar.xz
linux-8ebfd09255219ae55f8a101f6aeb0f64dd780d88.zip
iio: adc: ad4000: Check for error code from devm_mutex_init() call
Even if it's not critical, the avoidance of checking the error code from devm_mutex_init() call today diminishes the point of using devm variant of it. Tomorrow it may even leak something. Add the missed check. Fixes: 938fd562b974 ("iio: adc: Add support for AD4000") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20241030162013.2100253-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/ad4000.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c
index 6ea491245084..b4a23c97ee52 100644
--- a/drivers/iio/adc/ad4000.c
+++ b/drivers/iio/adc/ad4000.c
@@ -637,7 +637,9 @@ static int ad4000_probe(struct spi_device *spi)
indio_dev->name = chip->dev_name;
indio_dev->num_channels = 1;
- devm_mutex_init(dev, &st->lock);
+ ret = devm_mutex_init(dev, &st->lock);
+ if (ret)
+ return ret;
st->gain_milli = 1000;
if (chip->has_hardware_gain) {