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: pac1921: 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: 371f778b83cd ("iio: adc: add support for pac1921")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20241030162013.2100253-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
869aa5e8 8ebfd092

+3 -1
+3 -1
drivers/iio/adc/pac1921.c
··· 1170 1170 return dev_err_probe(dev, PTR_ERR(priv->regmap), 1171 1171 "Cannot initialize register map\n"); 1172 1172 1173 - devm_mutex_init(dev, &priv->lock); 1173 + ret = devm_mutex_init(dev, &priv->lock); 1174 + if (ret) 1175 + return ret; 1174 1176 1175 1177 priv->dv_gain = PAC1921_DEFAULT_DV_GAIN; 1176 1178 priv->di_gain = PAC1921_DEFAULT_DI_GAIN;