net-sysfs: fix netdev_queue_add_kobject() breakage
authorEric Dumazet <edumazet@google.com>
Thu, 21 Nov 2019 03:19:07 +0000 (19:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Nov 2019 06:15:12 +0000 (22:15 -0800)
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>
net/core/net-sysfs.c

index 4f404bf..ae3bcb1 100644 (file)
@@ -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);