Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: gyro: mpu3050: Fix out-of-sequence free_irq()

The triggered buffer is initialized before the IRQ is requested. The
removal path currently calls iio_triggered_buffer_cleanup() before
free_irq(). This violates the expected LIFO.

Place free_irq() in the correct location relative to
iio_triggered_buffer_cleanup().

Fixes: 3904b28efb2c7 ("iio: gyro: Add driver for the MPU-3050 gyroscope")
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Ethan Tidmore and committed by
Jonathan Cameron
d14116f6 4c057994

+1 -1
+1 -1
drivers/iio/gyro/mpu3050-core.c
··· 1278 1278 pm_runtime_get_sync(dev); 1279 1279 pm_runtime_put_noidle(dev); 1280 1280 pm_runtime_disable(dev); 1281 - iio_triggered_buffer_cleanup(indio_dev); 1282 1281 if (mpu3050->irq) 1283 1282 free_irq(mpu3050->irq, mpu3050->trig); 1283 + iio_triggered_buffer_cleanup(indio_dev); 1284 1284 mpu3050_power_down(mpu3050); 1285 1285 } 1286 1286