]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commitab0a582edb664e641a30bdee30d27131359f2528
tree5ed9a05d59383fcabee2a7a21ac1d7878962e798
parent9c2fa258ceca594669a24b5e5e22e72058f4289b
iio: pressure: bmp280: Tolerate IRQ before registering

BugLink: https://bugs.launchpad.net/bugs/1885322
[ Upstream commit 97b31a6f5fb95b1ec6575b78a7240baddba34384 ]

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: aae953949651 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/iio/pressure/bmp280-core.c