diff options
author | Eric Dumazet <edumazet@google.com> | 2019-11-21 04:19:07 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-21 07:15:12 +0100 |
commit | 48a322b6f9965b2f1e4ce81af972f0e287b07ed0 (patch) | |
tree | 6df17df9dbc5f79537c181180f04372c0951c47d | |
parent | Merge tag 'mlx5-fixes-2019-11-20' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
download | linux-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.c | 1 |
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); |