I've been thinking about this part. One possible approach is to switch to
devm_mdiobus_alloc() and devm_of_mdiobus_register() instead of
mdiobus_alloc() and of_mdiobus_register().
If i remember correctly, a later patch does that. Which is why this AI
bot points out the problem goes away later in the series.
I was trying to keep the patches simple, do one thing, be obviously
correct. Moving the code and changing to devm_* at the same time is
not "do one thing".
If it is possible to fix the issue by just moving the call to destroy
earlier in the error path, i would do that. That is the logical fix to
this patch. We then have the setup and the cleanup in symmetry.
Andrew