mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
iio: chemical: atlas-sensor: fix PM reference leak in buffer postenable
atlas_buffer_postenable() acquires a runtime PM reference with
pm_runtime_resume_and_get() but returns the result of
atlas_set_interrupt() directly. If atlas_set_interrupt() fails,
the runtime PM reference is leaked and the device can never
autosuspend.
Add pm_runtime_put_autosuspend() on the error path to balance
the reference.
Fixes: 0e4f336f50 ("iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()")
Cc: stable@vger.kernel.org
Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
a3c03cf36a
commit
bcd3f72e26
|
|
@ -413,7 +413,11 @@ static int atlas_buffer_postenable(struct iio_dev *indio_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return atlas_set_interrupt(data, true);
|
||||
ret = atlas_set_interrupt(data, true);
|
||||
if (ret)
|
||||
pm_runtime_put_autosuspend(&data->client->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int atlas_buffer_predisable(struct iio_dev *indio_dev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user