Re: [PATCH] iio: light: gp2ap002: Fix runtime PM leak in gp2ap002_read_raw()

From: Linus Walleij

Date: Wed Sep 16 2026 - 13:49:50 EST


On Wed, Sep 16, 2026 at 6:37 PM Wentao Liang <vulab@xxxxxxxxxxx> wrote:

> pm_runtime_get_sync() increments the usage counter even on failure,
> so every successful call must be paired with a put. A failure of
> gp2ap002_get_lux() returned early and skipped the paired
> pm_runtime_put_autosuspend(), permanently preventing runtime
> suspend. Jump to the common exit that releases the reference.
>
> Fixes: f6dbf83c17cb ("iio: light: gp2ap002: Take runtime PM reference on light read")
> Cc: stable@xxxxxxxxxxxxxxx

IMO not stable material.

> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij