linux-stable/drivers/iio
Krzysztof Kozlowski ffe5a99203 iio: adc: exynos-adc: Fix NULL pointer exception on unbind
commit 2ea8bab4dd upstream.

Fix NULL pointer exception on device unbind when device tree does not
contain "has-touchscreen" property.  In such case the input device is
not registered so it should not be unregistered.

    $ echo "12d10000.adc" > /sys/bus/platform/drivers/exynos-adc/unbind

    Unable to handle kernel NULL pointer dereference at virtual address 00000474
    ...
    (input_unregister_device) from [<c0772060>] (exynos_adc_remove+0x20/0x80)
    (exynos_adc_remove) from [<c0587d5c>] (platform_drv_remove+0x20/0x40)
    (platform_drv_remove) from [<c05860f0>] (device_release_driver_internal+0xdc/0x1ac)
    (device_release_driver_internal) from [<c0583ecc>] (unbind_store+0x60/0xd4)
    (unbind_store) from [<c031b89c>] (kernfs_fop_write+0x100/0x1e0)
    (kernfs_fop_write) from [<c029709c>] (__vfs_write+0x2c/0x17c)
    (__vfs_write) from [<c0297374>] (vfs_write+0xa4/0x184)
    (vfs_write) from [<c0297594>] (ksys_write+0x4c/0xac)
    (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28)

Fixes: 2bb8ad9b44 ("iio: exynos-adc: add experimental touchscreen support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 13:19:40 +01:00
..
accel iio: accel: kxcjk1013: Add KIOX010A ACPI Hardware-ID 2019-02-12 19:44:52 +01:00
adc iio: adc: exynos-adc: Fix NULL pointer exception on unbind 2019-03-23 13:19:40 +01:00
amplifiers
buffer iio:buffer: make length types match kfifo types 2018-07-03 11:23:11 +02:00
chemical iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius 2019-02-15 08:07:37 +01:00
common iio: hid-sensor: fix return of -EINVAL on invalid values in ret or value 2018-03-24 11:00:16 +01:00
dac iio: ad5064: Fix regulator handling 2018-11-13 11:16:57 -08:00
dummy iio: dummy: events: Add missing break 2017-10-27 10:38:06 +02:00
frequency iio: ad9523: Fix return value for ad952x_store() 2018-09-09 20:01:22 +02:00
gyro iio: bmg160: reset chip when probing 2017-04-12 12:41:11 +02:00
health iio: health: max30100: fixed parenthesis around FIFO count check 2017-02-09 08:08:30 +01:00
humidity iio: dht11: Use usleep_range instead of msleep for start signal 2017-02-09 08:08:30 +01:00
imu iio: adis_lib: Initialize trigger before requesting interrupt 2018-02-28 10:18:31 +01:00
light iio: light: rpr0521 poweroff for probe fails 2018-04-13 19:48:02 +02:00
magnetometer iio:st_magn: Fix enable device after trigger 2018-12-05 19:42:41 +01:00
orientation iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) 2016-11-05 17:47:47 +00:00
potentiometer iio: potentiometer: Fix typo in Kconfig 2016-07-03 12:40:01 +01:00
pressure iio: pressure: zpa2326: Remove always-true check which confuses gcc 2018-11-10 07:42:54 -08:00
proximity iio: proximity: sx9500: claim direct mode during raw proximity reads 2017-11-15 15:53:14 +01:00
temperature iio: maxim_thermocouple: detect invalid storage size in read() 2016-11-13 10:08:32 +01:00
trigger iio: trigger: free trigger resource correctly 2017-11-15 15:53:14 +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 iio: buffer: check if a buffer has been set up when poll is called 2018-02-28 10:18:31 +01:00
industrialio-configfs.c
industrialio-core.c iio: core: Return error for failed read_reg 2017-10-12 11:51:18 +02: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: helpers to determine own trigger 2016-09-10 16:49:14 +01:00
industrialio-triggered-event.c
inkern.c iio: core: Add devm_ APIs for iio_channel_{get,release}_all 2016-04-19 19:58:15 +01:00
Kconfig iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00
Makefile iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00