Skip to content

Commit 869aa5e

Browse files
andy-shevjic23
authored andcommitted
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: 371f778 ("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>
1 parent 8ebfd09 commit 869aa5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iio/adc/pac1921.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,9 @@ static int pac1921_probe(struct i2c_client *client)
11701170
return dev_err_probe(dev, PTR_ERR(priv->regmap),
11711171
"Cannot initialize register map\n");
11721172

1173-
devm_mutex_init(dev, &priv->lock);
1173+
ret = devm_mutex_init(dev, &priv->lock);
1174+
if (ret)
1175+
return ret;
11741176

11751177
priv->dv_gain = PAC1921_DEFAULT_DV_GAIN;
11761178
priv->di_gain = PAC1921_DEFAULT_DI_GAIN;

0 commit comments

Comments
 (0)