Skip to content

Commit 9037ac8

Browse files
andy-shevmachschmitt
authored andcommitted
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: 938fd56 ("iio: adc: Add support for AD4000") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 9ac6501 commit 9037ac8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iio/adc/ad4000.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,9 @@ static int ad4000_probe(struct spi_device *spi)
637637
indio_dev->name = chip->dev_name;
638638
indio_dev->num_channels = 1;
639639

640-
devm_mutex_init(dev, &st->lock);
640+
ret = devm_mutex_init(dev, &st->lock);
641+
if (ret)
642+
return ret;
641643

642644
st->gain_milli = 1000;
643645
if (chip->has_hardware_gain) {

0 commit comments

Comments
 (0)