From: Sasha Levin Date: Mon, 1 May 2023 11:26:02 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v5.15.111~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fdaf2f04c73ec5316da9578d62cf25b8041536b;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- 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 index 00000000000..34f9ab9fe00 --- /dev/null +++ b/queue-4.14/iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch @@ -0,0 +1,39 @@ +From 0c1137194b151e20d37424626e60c3d2e1e53f53 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Link: https://lore.kernel.org/r/20230313205029.1881745-1-risca@dalakolonin.se +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-4.14/series b/queue-4.14/series index 384a7d822f4..2346d42f567 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -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