Skip to content

Commit

Permalink
net-sysfs: fix netdev_queue_add_kobject() breakage
Browse files Browse the repository at this point in the history
kobject_put() should only be called in error path.

Fixes: b8eb718 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Jouni Hogander <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Nov 21, 2019
1 parent 064a189 commit 48a322b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 48a322b

Please sign in to comment.