Commit 48a322b6 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net-sysfs: fix netdev_queue_add_kobject() breakage

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>
parent 064a1899
...@@ -1474,6 +1474,7 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index) ...@@ -1474,6 +1474,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