linux/drivers/iio
Krzysztof Kozlowski addbcc62bc iio: ak8975: Fix NULL pointer exception on early interrupt
[ Upstream commit 07d2390e36 ]

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 [<c0379624>] (__wake_up+0x38/0x4c)
(__wake_up) from [<c0a41d30>] (ak8975_irq_handler+0x28/0x30)
(ak8975_irq_handler) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389c40>] (handle_edge_irq+0xf0/0x19c)
(handle_edge_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c05ee360>] (exynos_eint_gpio_irq+0x50/0x68)
(exynos_eint_gpio_irq) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389a70>] (handle_fasteoi_irq+0xb4/0x194)
(handle_fasteoi_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c03860b4>] (__handle_domain_irq+0x5c/0xb4)
(__handle_domain_irq) from [<c0301774>] (gic_handle_irq+0x54/0x94)
(gic_handle_irq) from [<c030c910>] (__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.

Cc: <stable@vger.kernel.org>
Fixes: 94a6d5cf7c ("iio:ak8975 Implement data ready interrupt handling")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-05-17 14:31:35 -04:00
..
accel iio: accel: hid-sensor-accel-3d: Fix memory leak in probe() 2015-08-27 13:26:03 -04:00
adc iio: adc: twl6030-gpadc: Fix modalias 2015-08-27 13:25:55 -04:00
amplifiers iio: amplifiers: ad8366: Remove regulator_put 2013-09-28 11:49:45 +01:00
common iio: st_sensors: Fix buffer copy 2014-11-05 18:33:43 +00:00
dac iio: dac: mcp4725: set iio name property in sysfs 2016-04-12 17:06:23 -04:00
frequency Merge 3.12-rc6 into staging-next. 2013-10-19 13:14:34 -07:00
gyro Revert "iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required" 2015-10-27 22:14:56 -04:00
humidity iio: remove .owner field for driver using module_platform_driver 2014-08-26 21:08:38 +01:00
imu iio: adis_buffer: Fix out-of-bounds memory access 2016-04-12 17:06:23 -04:00
light iio: light: hid-sensor-als.c: Fix memory leak in probe() 2015-08-27 13:26:02 -04:00
magnetometer iio: ak8975: Fix NULL pointer exception on early interrupt 2016-05-17 14:31:35 -04:00
orientation iio: remove .owner field for driver using module_platform_driver 2014-08-26 21:08:38 +01:00
pressure iio: pressure: mpl115: fix temperature offset sign 2016-04-12 17:06:24 -04:00
proximity iio: as3935: allocate correct iio_device size 2014-11-05 18:33:46 +00:00
temperature iio: tmp006: Check channel info on write 2015-08-04 14:16:31 -04:00
trigger iio: remove .owner field for driver using module_platform_driver 2014-08-26 21:08:38 +01:00
buffer_cb.c iio get rid of unneccessary error_ret 2014-02-18 08:46:36 +00:00
iio_core.h IIO: core: Introduce read_raw_multi 2014-04-29 22:05:32 +01:00
iio_core_trigger.h iio: fix semicolon in io_core_trigger.h 2013-08-03 18:40:32 +01:00
industrialio-buffer.c iio: industrialio-buffer: Fix iio_buffer_poll return value 2015-10-27 22:14:35 -04:00
industrialio-core.c iio: core: Fix double free. 2015-04-24 17:13:50 -04:00
industrialio-event.c iio: event: Remove negative error code from iio_event_poll 2015-10-27 22:14:34 -04:00
industrialio-trigger.c iio: Remove timestamp argument from iio_trigger_poll() and iio_trigger_poll_chained() 2014-06-14 16:25:59 +01:00
industrialio-triggered-buffer.c iio:triggered-buffer: Remove redundant call to iio_sw_buffer_preenable(). 2013-10-16 19:12:47 +01:00
inkern.c iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name 2014-08-25 16:55:28 +01:00
Kconfig iio: always select ANON_INODES 2014-05-10 11:39:57 +01:00
kfifo_buf.c iio: kfifo_buf: Implement data_available() callback 2013-12-03 20:22:28 +00:00
Makefile iio: Add AS3935 lightning sensor support 2014-03-16 18:00:32 +00:00