Commit 8ed633b9 authored by Wang Hai's avatar Wang Hai Committed by David S. Miller

Revert "net-sysfs: Fix memory leak in netdev_register_kobject"

This reverts commit 6b70fc94.

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: default avatarWang Hai <wanghai26@huawei.com>
Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a44acf90
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment