Skip to contentSkip to conversation

net-sysfs: fix netdev_queue_add_kobject() breakage

PATCH Applied Eric Dumazet 2 participants 2 messages Nov 21, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
Cc Jouni Hogander <[email protected]>
---
 net/core/net-sysfs.c | 1 +
 1 file changed, 1 insertion(+)
net/core/net-sysfs.c +1 -0
index 4f404bf33e44c977c1a8ba00706817b76215b75c..ae3bcb1540ec57df311dac6847323a23a74ec960 100644
@@ -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);
Signature · 1 line
2.24.0.432.g9d3f5f5b63-goog
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Wed, 20 Nov 2019 19:19:07 -0800

Quoted 5 lines

kobject_put() should only be called in error path.

Fixes b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
Cc Jouni Hogander <[email protected]>

Sorry, I should push back harder in the future.

Applied, thanks Eric.