Re: [PATCH] gpio: mpsse: fix reference leak in gpio_mpsse_probe() error paths
From: Bartosz Golaszewski
Date: Tue Dec 23 2025 - 11:09:34 EST
On Tue, Dec 23, 2025 at 7:53 AM Abdun Nihaal <nihaal@xxxxxxxxxxxxxx> wrote:
>
> The reference obtained by calling usb_get_dev() is not released in the
> gpio_mpsse_probe() error paths. Fix that by calling usb_put_dev().
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO")
> Signed-off-by: Abdun Nihaal <nihaal@xxxxxxxxxxxxxx>
> ---
> Compile tested only. Issue found using static analysis.
>
Hi!
The same should be done when the driver is unbound. Can you simplify
your patch by using devm_add_action_or_reset() instead? That way you
avoid all the gotos.
Bart