[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030162013.2100253-2-andriy.shevchenko@linux.intel.com>
Date: Wed, 30 Oct 2024 18:19:18 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Matteo Martelli <matteomartelli3@...il.com>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>
Subject: [PATCH v1 1/2] 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@...ux.intel.com>
---
drivers/iio/adc/ad4000.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c
index 6ea491245084..b4a23c97ee52 100644
--- a/drivers/iio/adc/ad4000.c
+++ b/drivers/iio/adc/ad4000.c
@@ -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) {
--
2.43.0.rc1.1336.g36b5255a03ac
Powered by blists - more mailing lists