iio: adc: palmas_gpadc: fix NULL dereference on rmmod
authorPatrik Dahlström <risca@dalakolonin.se>
Mon, 13 Mar 2023 20:50:29 +0000 (21:50 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 18 Mar 2023 16:11:25 +0000 (16:11 +0000)
commit49f76c499d38bf67803438eee88c8300d0f6ce09
tree16a70e9e50f94ebe0a0edbfce1303c74cda256d6
parent7b3825e9487d77e83bf1e27b10a74cd729b8f972
iio: adc: palmas_gpadc: fix NULL dereference on rmmod

Calling dev_to_iio_dev() on a platform device pointer is undefined and
will make adc NULL.

Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
Link: https://lore.kernel.org/r/20230313205029.1881745-1-risca@dalakolonin.se
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/palmas_gpadc.c