From: sashiko-bot@kernel.org
To: "Wentao Liang" <vulab@iscas.ac.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: musb: ux500: Fix transceiver leak in ux500_musb_init()
Date: Sat, 07 Nov 2026 16:51:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-203075@kernel.org> (raw)
In-Reply-To: <20261107164653.481516-1-vulab@iscas.ac.cn>
> ux500_musb_init() takes a reference on the USB2 transceiver with
> usb_get_phy() and stores it in musb->xceiv. If the following
> usb_register_notifier() fails, the function returns without releasing
> that reference.
>
> The reference is only dropped in ux500_musb_exit(), and that callback is
> not reached on this path: musb_init_controller() jumps straight to its
> fail1 label when musb_platform_init() returns an error, while
> musb_platform_exit() is only called from the fail2 path. The reference is
> therefore leaked.
>
> Put the transceiver on the notifier registration failure path. The
> notifier itself does not need to be unregistered, since
> usb_register_notifier() failed and never added it to the chain.
>
> The bug was found with a static analysis tool; the candidate was then
> audited and the fix written with the help of DeepSeek-V4.1-Flash and
> GPT-6.1-Sol, and the result was checked by hand before submission.
>
> Fixes: 0135522c4898 ("usb: musb: ux500: add otg notifier support")
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/all/20260916165055.2085246-1-vulab@iscas.ac.cn/
> Reviewed-by: Linus Walleij <linusw@kernel.org>
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261107164653.481516-1-vulab@iscas.ac.cn?part=1
prev parent reply other threads:[~2026-11-07 16:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 16:50 [PATCH] usb: musb: ux500: Fix transceiver leak in ux500_musb_init() Wentao Liang
2026-09-16 17:33 ` Linus Walleij
2026-09-16 17:38 ` Greg KH
2026-11-07 16:46 ` [PATCH v2] " Wentao Liang
2026-11-07 16:51 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-203075@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox