Re: [PATCH net] net: bgmac: unregister the fixed PHY on probe failure and removal

From: Florian Fainelli

Date: Mon Nov 30 2026 - 13:32:48 EST


On 11/28/26 07:08, Simon Horman wrote:
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.

Thanks, yes, this is mostly defensive at this point, but it helps keep the noise floor level down with Sashiko such that subsequent changes are more meaningful when reivewed.
--
Florian