Skip to content

Commit

Permalink
Revert "net-sysfs: Fix memory leak in netdev_register_kobject"
Browse files Browse the repository at this point in the history
This reverts commit 6b70fc9.

The reverted bugfix will cause another issue.
Reported by syzbot+6024817a931b2830bc93@syzkaller.appspotmail.com.
See https://syzkaller.appspot.com/x/log.txt?x=1737671b200000 for
details.

Signed-off-by: Wang Hai <wanghai26@huawei.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wang Hai authored and David S. Miller committed Apr 15, 2019
1 parent a44acf9 commit 8ed633b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,20 +1747,16 @@ int netdev_register_kobject(struct net_device *ndev)

error = device_add(dev);
if (error)
goto error_put_device;
return error;

error = register_queue_kobjects(ndev);
if (error)
goto error_device_del;
if (error) {
device_del(dev);
return error;
}

pm_runtime_set_memalloc_noio(dev, true);

return 0;

error_device_del:
device_del(dev);
error_put_device:
put_device(dev);
return error;
}

Expand Down

0 comments on commit 8ed633b

Please sign in to comment.