[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241101131705.3697913-3-andriy.shevchenko@linux.intel.com>
Date: Fri, 1 Nov 2024 15:16:02 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: [PATCH v3 2/4] iio: light: ltr501: Assign NULL to ddata in ltr501_probe()
When iio_get_acpi_device_name_and_data() fails, the ddata may be left
uninitialised. Initialise it to NULL.
Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stanley.mountain
Fixes: 61da460b813d ("iio: light: ltr501: Replace a variant of iio_get_acpi_device_name_and_data()")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/iio/light/ltr501.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 7228611d4c59..616dc6921702 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1424,8 +1424,8 @@ static int ltr501_probe(struct i2c_client *client)
struct ltr501_data *data;
struct iio_dev *indio_dev;
struct regmap *regmap;
+ const void *ddata = NULL;
int partid, chip_idx;
- const void *ddata;
const char *name;
int ret;
--
2.43.0.rc1.1336.g36b5255a03ac
Powered by blists - more mailing lists