aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-12 21:33:50 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-12 21:33:50 -0400
commitae1b6a31b1f9ef2c7ba5ef89799f210a9ba6937c (patch)
tree76f26c291c480345de8d70a6c37143c43ac5f749
parent2de58e30db3f7e83592e22fb459dd6695b648889 (diff)
[AX25]: Potential ax25_uid_assoc-s leaks on module unload.
The ax25_uid_free call walks the ax25_uid_list and releases entries from it. The problem is that after the fisrt call to hlist_del_init the hlist_for_each_entry (which hides behind the ax25_uid_for_each) will consider the current position to be the last and will return. Thus, the whole list will be left not freed. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ax25/ax25_uid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index 5f4eb73fb9d3..57aeba729bae 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -218,9 +218,11 @@ void __exit ax25_uid_free(void)
218 struct hlist_node *node; 218 struct hlist_node *node;
219 219
220 write_lock(&ax25_uid_lock); 220 write_lock(&ax25_uid_lock);
221again:
221 ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) { 222 ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) {
222 hlist_del_init(&ax25_uid->uid_node); 223 hlist_del_init(&ax25_uid->uid_node);
223 ax25_uid_put(ax25_uid); 224 ax25_uid_put(ax25_uid);
225 goto again;
224 } 226 }
225 write_unlock(&ax25_uid_lock); 227 write_unlock(&ax25_uid_lock);
226} 228}