Re: [PATCH] sh: kfr2r09: Fix USB gadget I2C adapter reference leak
From: Geert Uytterhoeven
Date: Wed Jun 24 2026 - 04:21:28 EST
Hi Haoxiang,
On Tue, 23 Jun 2026 at 11:03, Haoxiang Li <haoxiang_li2024@xxxxxxx> wrote:
> kfr2r09_usb0_gadget_i2c_setup() gets I2C adapter 0 with
> i2c_get_adapter(), but returns without dropping the reference.
> Release the adapter with i2c_put_adapter() before returning
> from all paths after i2c_get_adapter() succeeds.
>
> Fixes: 5a1c4cb5bc22 ("sh: add r8a66597 usb0 gadget to the kfr2r09 board")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
Thanks for your patch!
Before posting (or better: writing) a patch, please check if it has been
posted before:
"[PATCH 0/2] sh: kfr2r09: fix i2c adapter leaks"
https://lore.kernel.org/20260508120601.426115-1-johan@xxxxxxxxxx/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds