From: Greg Kroah-Hartman Date: Sun, 8 May 2016 16:25:42 +0000 (+0200) Subject: 3.14-stable patches X-Git-Tag: v3.14.69~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9892d90cc8f6e71bb48500e798c663c9b1e3cfdc;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch --- diff --git a/queue-3.14/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch b/queue-3.14/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch new file mode 100644 index 00000000000..7d58a36ddd1 --- /dev/null +++ b/queue-3.14/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch @@ -0,0 +1,72 @@ +From 07d2390e36ee5b3265e9cc8305f2a106c8721e16 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 4 Apr 2016 14:54:59 +0900 +Subject: iio: ak8975: Fix NULL pointer exception on early interrupt + +From: Krzysztof Kozlowski + +commit 07d2390e36ee5b3265e9cc8305f2a106c8721e16 upstream. + +In certain probe conditions the interrupt came right after registering +the handler causing a NULL pointer exception because of uninitialized +waitqueue: + +$ udevadm trigger +i2c-gpio i2c-gpio-1: using pins 143 (SDA) and 144 (SCL) +i2c-gpio i2c-gpio-3: using pins 53 (SDA) and 52 (SCL) +Unable to handle kernel NULL pointer dereference at virtual address 00000000 +pgd = e8b38000 +[00000000] *pgd=00000000 +Internal error: Oops: 5 [#1] SMP ARM +Modules linked in: snd_soc_i2s(+) i2c_gpio(+) snd_soc_idma snd_soc_s3c_dma snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore ac97_bus spi_s3c64xx pwm_samsung dwc2 exynos_adc phy_exynos_usb2 exynosdrm exynos_rng rng_core rtc_s3c +CPU: 0 PID: 717 Comm: data-provider-m Not tainted 4.6.0-rc1-next-20160401-00011-g1b8d87473b9e-dirty #101 +Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) +(...) +(__wake_up_common) from [] (__wake_up+0x38/0x4c) +(__wake_up) from [] (ak8975_irq_handler+0x28/0x30) +(ak8975_irq_handler) from [] (handle_irq_event_percpu+0x88/0x140) +(handle_irq_event_percpu) from [] (handle_irq_event+0x44/0x68) +(handle_irq_event) from [] (handle_edge_irq+0xf0/0x19c) +(handle_edge_irq) from [] (generic_handle_irq+0x24/0x34) +(generic_handle_irq) from [] (exynos_eint_gpio_irq+0x50/0x68) +(exynos_eint_gpio_irq) from [] (handle_irq_event_percpu+0x88/0x140) +(handle_irq_event_percpu) from [] (handle_irq_event+0x44/0x68) +(handle_irq_event) from [] (handle_fasteoi_irq+0xb4/0x194) +(handle_fasteoi_irq) from [] (generic_handle_irq+0x24/0x34) +(generic_handle_irq) from [] (__handle_domain_irq+0x5c/0xb4) +(__handle_domain_irq) from [] (gic_handle_irq+0x54/0x94) +(gic_handle_irq) from [] (__irq_usr+0x50/0x80) + +The bug was reproduced on exynos4412-trats2 (with a max77693 device also +using i2c-gpio) after building max77693 as a module. + +Fixes: 94a6d5cf7caa ("iio:ak8975 Implement data ready interrupt handling") +Signed-off-by: Krzysztof Kozlowski +Tested-by: Gregor Boirie +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/magnetometer/ak8975.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/iio/magnetometer/ak8975.c ++++ b/drivers/iio/magnetometer/ak8975.c +@@ -151,6 +151,8 @@ static int ak8975_setup_irq(struct ak897 + int rc; + int irq; + ++ init_waitqueue_head(&data->data_ready_queue); ++ clear_bit(0, &data->flags); + if (client->irq) + irq = client->irq; + else +@@ -166,8 +168,6 @@ static int ak8975_setup_irq(struct ak897 + return rc; + } + +- init_waitqueue_head(&data->data_ready_queue); +- clear_bit(0, &data->flags); + data->eoc_irq = irq; + + return rc; diff --git a/queue-3.14/series b/queue-3.14/series index db651f4f545..ea07da47592 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -18,3 +18,4 @@ x86-sysfb_efi-fix-valid-bar-address-range-check.patch acpica-dispatcher-update-thread-id-for-recursive-method-calls.patch usb-serial-cp210x-add-id-for-link-ecu.patch usb-serial-cp210x-add-straizona-focusers-device-ids.patch +iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch