linux/drivers/iio
Lukas Wunner 0964e40947 iio: adc: mcp320x: Fix oops on module unload
The driver calls spi_get_drvdata() in its ->remove hook even though it
has never called spi_set_drvdata().  Stack trace for posterity:

Unable to handle kernel NULL pointer dereference at virtual address 00000220
Internal error: Oops: 5 [#1] SMP ARM
[<8072f564>] (mutex_lock) from [<7f1400d0>] (iio_device_unregister+0x24/0x7c [industrialio])
[<7f1400d0>] (iio_device_unregister [industrialio]) from [<7f15e020>] (mcp320x_remove+0x20/0x30 [mcp320x])
[<7f15e020>] (mcp320x_remove [mcp320x]) from [<8055a8cc>] (spi_drv_remove+0x2c/0x44)
[<8055a8cc>] (spi_drv_remove) from [<805087bc>] (__device_release_driver+0x98/0x134)
[<805087bc>] (__device_release_driver) from [<80509180>] (driver_detach+0xdc/0xe0)
[<80509180>] (driver_detach) from [<8050823c>] (bus_remove_driver+0x5c/0xb0)
[<8050823c>] (bus_remove_driver) from [<80509ab0>] (driver_unregister+0x38/0x58)
[<80509ab0>] (driver_unregister) from [<7f15e69c>] (mcp320x_driver_exit+0x14/0x1c [mcp320x])
[<7f15e69c>] (mcp320x_driver_exit [mcp320x]) from [<801a78d0>] (SyS_delete_module+0x184/0x1d0)
[<801a78d0>] (SyS_delete_module) from [<80108100>] (ret_fast_syscall+0x0/0x1c)

Fixes: f5ce4a7a92 ("iio: adc: add driver for MCP3204/08 12-bit ADC")
Cc: Oskar Andero <oskar.andero@gmail.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-09-24 16:58:03 +01:00
..
accel Second set of IIO new device support, features and cleanup for the 4.14 cycle. 2017-08-20 10:42:42 -07:00
adc iio: adc: mcp320x: Fix oops on module unload 2017-09-24 16:58:03 +01:00
amplifiers
buffer iio: buffer-dmaengine: Add missing header buffer_impl.h 2017-06-13 20:56:05 +01:00
chemical iio: chemical: ccs811: Add triggered buffer support 2017-08-18 08:08:02 +01:00
common iio: magnetometer: st_magn: fix drdy line configuration for LIS3MDL 2017-09-03 17:39:39 +01:00
counter iio: pc104: Mask PC/104 drivers via the PC104 Kconfig option 2017-03-15 21:59:08 +00:00
dac iio: dac: stm32-dac-core: explicitly request exclusive reset control 2017-08-20 15:41:18 +01:00
dummy iio:dummy: Stop enabling timestamp by default. 2017-01-10 19:54:55 +00:00
frequency
gyro iio: gyro: st_gyro_spi: add OF capability to st_gyro_spi 2017-07-02 10:24:56 +01:00
health First set of IIO new device support, features and cleanup for the 4.12 cycle. 2017-03-06 13:17:21 +01:00
humidity iio: humidity: hts221: move drdy enable logic in hts221_trig_set_state() 2017-07-25 20:03:04 +01:00
imu iio: adis16400: Change unsigned to unsigned int 2017-07-02 10:27:03 +01:00
light Second set of IIO new device support, features and cleanup for the 4.14 cycle. 2017-08-20 10:42:42 -07:00
magnetometer iio: magnetometer: st_magn: fix drdy line configuration for LIS3MDL 2017-09-03 17:39:39 +01:00
multiplexer iio: multiplexer: new iio category and iio-mux driver 2017-06-03 19:29:26 +09:00
orientation iio: orientation: hid-sensor-rotation: Drop unnecessary static 2017-07-17 21:45:01 +01:00
potentiometer iio: max5481: Add support for Maxim digital potentiometers 2017-01-28 12:13:31 +00:00
potentiostat iio: lmp91000: Set parent device 2017-02-19 12:01:52 +00:00
pressure Second set of IIO new device support, features and cleanup for the 4.14 cycle. 2017-08-20 10:42:42 -07:00
proximity iio: srf08: add support for srf02 in i2c mode 2017-08-18 08:04:17 +01:00
temperature iio: temperature: tsys01: Add OF match table 2017-07-01 10:16:42 +01:00
trigger iio: trigger: stm32-timer: fix a corner case to write preset 2017-09-24 13:09:57 +01:00
iio_core.h iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
iio_core_trigger.h
industrialio-buffer.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
industrialio-configfs.c
industrialio-core.c iio: add hardware triggered operating mode 2017-06-11 15:58:41 +01:00
industrialio-event.c iio: iio_push_event(): Don't crash if the event interface is not registered 2016-09-10 16:40:44 +01:00
industrialio-sw-device.c iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00
industrialio-sw-trigger.c
industrialio-trigger.c iio: trigger: fix NULL pointer dereference in iio_trigger_write_current() 2017-05-21 12:36:59 +01:00
industrialio-triggered-event.c
inkern.c First round of IIO new device support, features and cleanups for the 4.14 cycle. 2017-07-27 21:29:49 -07:00
Kconfig iio: multiplexer: new iio category and iio-mux driver 2017-06-03 19:29:26 +09:00
Makefile iio: multiplexer: new iio category and iio-mux driver 2017-06-03 19:29:26 +09:00