iio: adc: ad7173: fix using shared static info struct
Fix a possible race condition during driver probe in the ad7173 driver due to using a shared static info struct. If more that one instance of the driver is probed at the same time, some of the info could be overwritten by the other instance, leading to incorrect operation. To fix this, make the static info struct const so that it is read-only and make a copy of the info struct for each instance of the driver that can be modified. Reported-by:Uwe Kleine-König <u.kleine-koenig@baylibre.com> Fixes: 76a1e6a4 ("iio: adc: ad7173: add AD7173 driver") Signed-off-by:
David Lechner <dlechner@baylibre.com> Tested-by:
Guillaume Ranquet <granquet@baylibre.com> Link: https://patch.msgid.link/20241127-iio-adc-ad7313-fix-non-const-info-struct-v2-1-b6d7022b7466@baylibre.com Cc: <Stable@vger.kernel.org> Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Loading
Please sign in to comment