mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[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>
This commit is contained in:
parent
2de58e30db
commit
ae1b6a31b1
1 changed files with 2 additions and 0 deletions
|
@ -218,9 +218,11 @@ void __exit ax25_uid_free(void)
|
|||
struct hlist_node *node;
|
||||
|
||||
write_lock(&ax25_uid_lock);
|
||||
again:
|
||||
ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) {
|
||||
hlist_del_init(&ax25_uid->uid_node);
|
||||
ax25_uid_put(ax25_uid);
|
||||
goto again;
|
||||
}
|
||||
write_unlock(&ax25_uid_lock);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue