Skip to content

Commit 62b44eb

Browse files
harshimogalapallijic23
authored andcommitted
iio: sca3000: Fix a resource leak in sca3000_probe()
spi->irq from request_threaded_irq() not released when iio_device_register() fails. Add an return value check and jump to a common error handler when iio_device_register() fails. Fixes: 9a4936d ("staging:iio:accel:sca3000 Tidy up probe order to avoid a race.") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent dc81be9 commit 62b44eb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/iio/accel/sca3000.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,11 @@ static int sca3000_probe(struct spi_device *spi)
14871487
if (ret)
14881488
goto error_free_irq;
14891489

1490-
return iio_device_register(indio_dev);
1490+
ret = iio_device_register(indio_dev);
1491+
if (ret)
1492+
goto error_free_irq;
1493+
1494+
return 0;
14911495

14921496
error_free_irq:
14931497
if (spi->irq)

0 commit comments

Comments
 (0)