]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: light: bh1780: fix PM runtime leak on error path
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 30 Jan 2026 11:30:20 +0000 (13:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Mar 2026 15:15:30 +0000 (16:15 +0100)
commit33661bfc85c14836bfef4425a74b0ca2df4bb5ad
tree0916acc0109a3a507d5668ac9acfc11431471c06
parentacce8ebc5e63cfbe85d1490ba3da4b7c39cb2796
iio: light: bh1780: fix PM runtime leak on error path

commit dd72e6c3cdea05cad24e99710939086f7a113fb5 upstream.

Move pm_runtime_put_autosuspend() before the error check to ensure
the PM runtime reference count is always decremented after
pm_runtime_get_sync(), regardless of whether the read operation
succeeds or fails.

Fixes: 1f0477f18306 ("iio: light: new driver for the ROHM BH1780")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/bh1780.c