net-sysfs: fix netdev_queue_add_kobject() breakage
authorEric Dumazet <edumazet@google.com>
Thu, 21 Nov 2019 03:19:07 +0000 (19:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 14:02:36 +0000 (15:02 +0100)
commit5f36336849edd9c3294adc4f93141c0261b98034
tree2dcf347856654bdc1026ee921d0e18293111120c
parent7ac7cc5e78444a84e5786e822ca6643ad4cd55f7
net-sysfs: fix netdev_queue_add_kobject() breakage

commit 48a322b6f9965b2f1e4ce81af972f0e287b07ed0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/net-sysfs.c