summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-11-21 04:19:07 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-21 07:15:12 +0100
commit48a322b6f9965b2f1e4ce81af972f0e287b07ed0 (patch)
tree6df17df9dbc5f79537c181180f04372c0951c47d
parentMerge tag 'mlx5-fixes-2019-11-20' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
downloadlinux-48a322b6f9965b2f1e4ce81af972f0e287b07ed0.tar.xz
linux-48a322b6f9965b2f1e4ce81af972f0e287b07ed0.zip
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);