]> git.baikalelectronics.ru Git - kernel.git/commit
iio: pressure: bmp280: Tolerate IRQ before registering
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 23 Mar 2020 10:41:25 +0000 (12:41 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:18 +0000 (16:56 +0100)
commit9c80447f57142240f25026ff92ec0f82db96e3ae
tree1706a8316434d8c620f1488944631b5f81661c82
parent445249945b45503b3d19299a325bd25da55acfe0
iio: pressure: bmp280: Tolerate IRQ before registering

With DEBUG_SHIRQ enabled we have a kernel crash

[  116.482696] BUG: kernel NULL pointer dereference, address: 0000000000000000

...

[  116.606571] Call Trace:
[  116.609023]  <IRQ>
[  116.611047]  complete+0x34/0x50
[  116.614206]  bmp085_eoc_irq+0x9/0x10 [bmp280]

because DEBUG_SHIRQ mechanism fires an IRQ before registration and drivers
ought to be able to handle an interrupt happening before request_irq() returns.

Fixes: 293d6f900507 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-core.c