Re: [PATCH net] net: bgmac: unregister the fixed PHY on probe failure and removal
From: Simon Horman
Date: Sat Nov 28 2026 - 10:09:13 EST
On Tue, Nov 24, 2026 at 12:40:58AM +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 1 · Medium: 1 (1) · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [High] The new bgmac_phy_disconnect() reads phydev after
> phy_disconnect() may have freed it, which is a use-after-free on the…
> - [Medium] bgmac_phy_disconnect() picks the release method from the
> device tree, not from how the connected PHY was registered.
Hi Florian,
I'm suspecting that neither of the above two issues manifest
with in-tree DT. And if so, I'm thinking they are more theoretical
bugs than manifesting ones.
But none the less, maybe it would be nice to make things a bit more robust
at some point. Either by prohibiting configurations that lead to the
conditions described at setup-time. Or making the tear-down more symmetric
with setup.
Nonetheless, I agree this patch fixes a bug in a minimal way appropriate
for net.
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
...