[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD++jLkqNNpn5FvChe6FSrZMio_p1tee4iuvjLCeE6rAG7rz=A@mail.gmail.com>
Date: Tue, 3 Feb 2026 01:30:51 +0100
From: Linus Walleij <linusw@...nel.org>
To: Wei Li <unsw.weili@...il.com>
Cc: tony@...mide.com, haojian.zhuang@...aro.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] pinctrl: single: fix refcount leak in pcs_add_gpio_func()
On Tue, Jan 20, 2026 at 9:07 AM Wei Li <unsw.weili@...il.com> wrote:
> of_parse_phandle_with_args() returns a device_node pointer with refcount
> incremented in gpiospec.np. The loop iterates through all phandles but
> never releases the reference, causing a refcount leak on each iteration.
>
> Add of_node_put() calls to release the reference after extracting the
> needed arguments and on the error path when devm_kzalloc() fails.
>
> This bug was detected by our static analysis tool and verified by my
> code review.
>
> Fixes: a1a277eb76b3 ("pinctrl: single: create new gpio function range")
> Cc: stable@...r.kernel.org
Skipping this, it's not a critical bug.
> Signed-off-by: Wei Li <unsw.weili@...il.com>
Patch applied.
Yours,
Linus Walleij
Powered by blists - more mailing lists