Re: [PATCH] net: mdiobus: Fix memory leak in __mdiobus_register

From: Pavel Skripkin
Date: Tue Sep 28 2021 - 07:04:55 EST

On 9/28/21 13:55, Dan Carpenter wrote:
On Tue, Sep 28, 2021 at 01:46:56PM +0300, Pavel Skripkin wrote:
On 9/28/21 13:39, Dan Carpenter wrote:
> No, the syzbot link was correct.
Link is correct, but Yanfei's patch does not fix this bug. Syzbot reported
leak, that you described below, not the Yanfei one.

I promise you that Yanfei's link was correct. That bug was in
__devm_mdiobus_register(). It's a totally separate issue.

I must be missing something, or we are talking about different links :)

Let me explain why I think, that Yanfei's patch cannot fix leak reported by syzkaller [1] (I hope, we are talking about this link)

Yanfei has changed this code part:

err = device_register(&bus->dev);
if (err) {
(*) pr_err("mii_bus %s failed to register\n", bus->id);
return -EINVAL;

So, if executing gets into this branch we should see error message (*), right? There is no such message into log file on bug report page [1], so how is it possible?


With regards,
Pavel Skripkin