summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-11-20 19:19:07 -0800
committerDavid S. Miller <davem@davemloft.net>2019-11-20 22:15:12 -0800
commit48a322b6f9965b2f1e4ce81af972f0e287b07ed0 (patch)
tree6df17df9dbc5f79537c181180f04372c0951c47d
parent064a18998b0b0149c1733266bc0ed9f49074365e (diff)
net-sysfs: fix netdev_queue_add_kobject() breakage
kobject_put() should only be called in error path. Fixes: b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jouni Hogander <jouni.hogander@unikie.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/net-sysfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 4f404bf33e44..ae3bcb1540ec 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1474,6 +1474,7 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)
#endif
kobject_uevent(kobj, KOBJ_ADD);
+ return 0;
err:
kobject_put(kobj);