[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241122-iio-adc-ad7313-fix-non-const-info-struct-v1-0-d05c02324b73@baylibre.com>
Date: Fri, 22 Nov 2024 11:39:51 -0600
From: David Lechner <dlechner@...libre.com>
To: Jonathan Cameron <jic23@...nel.org>,
Dumitru Ceclan <mitrutzceclan@...il.com>
Cc: Michael Hennerich <Michael.Hennerich@...log.com>,
Nuno Sa <nuno.sa@...log.com>, Michael Walle <michael@...le.cc>,
Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Guillaume Ranquet <granquet@...libre.com>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
David Lechner <dlechner@...libre.com>
Subject: [PATCH 0/2] iio: adc: ad7313: fix non-const info struct
While working ad7124, Uwe pointed out a bug in the ad7313 driver.
static struct ad_sigma_delta_info ad7173_sigma_delta_info was not const
and was being modified during driver probe, which could lead to race
conditions if two instances of the driver were probed at the same time.
I've made an attempt to fix it, but it isn't exactly trivial and I have
only compile tested it. Guillaume has access to ad4111 hardware, so it
would be good to get a Tested-by from him to make sure this doesn't
break anything.
Reported-by: Uwe Kleine-König <u.kleine-koenig@...libre.com>
---
David Lechner (2):
iio: adc: ad7313: fix irq number stored in static info struct
iio: adc: ad7173: make struct ad_sigma_delta_info ad7173_sigma_delta_info const
drivers/iio/adc/ad7173.c | 476 +++++++++++++++++----------------
drivers/iio/adc/ad_sigma_delta.c | 14 +-
include/linux/iio/adc/ad_sigma_delta.h | 5 +-
3 files changed, 264 insertions(+), 231 deletions(-)
---
base-commit: 9dd2270ca0b38ee16094817f4a53e7ba78e31567
change-id: 20241122-iio-adc-ad7313-fix-non-const-info-struct-92e59b91ee2e
Best regards,
--
David Lechner <dlechner@...libre.com>
Powered by blists - more mailing lists