Commit 7070695e authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

net-sysfs: fix netdev_queue_add_kobject() breakage

commit 48a322b6 upstream.

kobject_put() should only be called in error path.

Fixes: b8eb7183 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Jouni Hogander <jouni.hogander@unikie.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60e71546
...@@ -1484,6 +1484,7 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index) ...@@ -1484,6 +1484,7 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)
#endif #endif
kobject_uevent(kobj, KOBJ_ADD); kobject_uevent(kobj, KOBJ_ADD);
return 0;
err: err:
kobject_put(kobj); kobject_put(kobj);
......
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