Skip to contentSkip to conversation

net: add missing dev_put() in __netdev_adjacent_dev_insert

PATCH Applied Nikolay Aleksandrov 3 participants 3 messages Oct 23, 2013 – Oct 25, 2013

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

PATCH 1/1 net: add missing dev_put() in __netdev_adjacent_dev_insert

I think that a dev_put() is needed in the error path to preserve the proper dev refcount.

---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)
net/core/dev.c +1 -0
index 0918aad..bdffd65 100644
@@ -4648,6 +4648,7 @@ remove_symlinks:
 
 free_adj:
 	kfree(adj);
+	dev_put(adj_dev);
 
 	return ret;
 }
Signature · 1 line
1.8.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Nikolay Aleksandrov

I think that a dev_put() is needed in the error path to preserve the proper dev refcount.

True, forgot about it. Thanks for spotting this!

Quoted 22 lines

---
net/core/dev.c | 1 +

1 file changed, 1 insertion(+)
net/core/dev.c +0 -0
index 0918aad..bdffd65 100644
@@ -4648,6 +4648,7 @@ remove_symlinks:
 

free_adj:

	kfree(adj);
net/core/dev.c +1 -0
+	dev_put(adj_dev);
	return ret;
}
Signature · 1 line
1.8.1.4