Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
8ebfd092 f35f3c83

+3 -1
+3 -1
drivers/iio/adc/ad4000.c
··· 637 637 indio_dev->name = chip->dev_name; 638 638 indio_dev->num_channels = 1; 639 639 640 - devm_mutex_init(dev, &st->lock); 640 + ret = devm_mutex_init(dev, &st->lock); 641 + if (ret) 642 + return ret; 641 643 642 644 st->gain_milli = 1000; 643 645 if (chip->has_hardware_gain) {