]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Mon, 1 May 2023 11:26:02 +0000 (07:26 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 1 May 2023 11:26:02 +0000 (07:26 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch b/queue-4.14/iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch
new file mode 100644 (file)
index 0000000..34f9ab9
--- /dev/null
@@ -0,0 +1,39 @@
+From 0c1137194b151e20d37424626e60c3d2e1e53f53 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 13 Mar 2023 21:50:29 +0100
+Subject: iio: adc: palmas_gpadc: fix NULL dereference on rmmod
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Patrik Dahlström <risca@dalakolonin.se>
+
+[ Upstream commit 49f76c499d38bf67803438eee88c8300d0f6ce09 ]
+
+Calling dev_to_iio_dev() on a platform device pointer is undefined and
+will make adc NULL.
+
+Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
+Link: https://lore.kernel.org/r/20230313205029.1881745-1-risca@dalakolonin.se
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/adc/palmas_gpadc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
+index f5218461ae255..f422df4daadcb 100644
+--- a/drivers/iio/adc/palmas_gpadc.c
++++ b/drivers/iio/adc/palmas_gpadc.c
+@@ -634,7 +634,7 @@ static int palmas_gpadc_probe(struct platform_device *pdev)
+ static int palmas_gpadc_remove(struct platform_device *pdev)
+ {
+-      struct iio_dev *indio_dev = dev_to_iio_dev(&pdev->dev);
++      struct iio_dev *indio_dev = dev_get_drvdata(&pdev->dev);
+       struct palmas_gpadc *adc = iio_priv(indio_dev);
+       if (adc->wakeup1_enable || adc->wakeup2_enable)
+-- 
+2.39.2
+
index 384a7d822f4559ecb01a4b1319a3c9637021a699..2346d42f567424f08a61e0b355f63b87d0c0406d 100644 (file)
@@ -1,3 +1,4 @@
 wifi-brcmfmac-slab-out-of-bounds-read-in-brcmf_get_assoc_ies.patch
 bluetooth-perform-careful-capability-checks-in-hci_sock_ioctl.patch
 usb-serial-option-add-unisoc-vendor-and-tozed-lt70c-product.patch
+iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch