Skip to content

Commit

Permalink
iio: adc: ad4000: Check for error code from devm_mutex_init() call
Browse files Browse the repository at this point in the history
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>
Link: https://patch.msgid.link/20241030162013.2100253-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Andy Shevchenko authored and Jonathan Cameron committed Nov 1, 2024
1 parent f35f3c8 commit 8ebfd09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/iio/adc/ad4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8ebfd09

Please sign in to comment.