Re: [PATCH v2] leds: netxbig: Fix platform device reference leak on successful probe
From: Lee Jones
Date: Wed Nov 18 2026 - 12:20:24 EST
On Sat, 07 Nov 2026, Wentao Liang wrote:
> of_find_device_by_node() returns the GPIO extension device with an
> elevated reference count. The error paths release it through the
> put_device label, but the success path returns directly, so the
> reference is leaked whenever the LED driver probes successfully.
>
> Release the reference right after its last use and remove the put_device
> label and the gotos leading to it.
>
> Fixes: 9af512e81964 ("leds: netxbig: Convert to use GPIO descriptors")
> Suggested-by: Lee Jones <lee@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> Changes in v2:
> - Release the reference right after its last use and remove the put_device
> label and the gotos, as suggested.
> - Apologies for the very late reply.
> drivers/leds/leds-netxbig.c | 74 ++++++++++++++-----------------------
> 1 file changed, 27 insertions(+), 47 deletions(-)
Much nicer, thanks.
In future, please submit versions on their own.
Attaching them to previous submissions gets real confusing, real quick.
--
Lee Jones