Skip to content

Commit

Permalink
netfilter: nf_conntrack_gre: nf_ct_gre_keymap_flush() fixlet
Browse files Browse the repository at this point in the history
It does "kfree(list_head)" which looks wrong because entity that was
allocated is definitely not list_head.

However, this all works because list_head is first item in
struct nf_ct_gre_keymap.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Sep 8, 2008
1 parent 887464a commit 51807e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/netfilter/nf_conntrack_proto_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ static LIST_HEAD(gre_keymap_list);

void nf_ct_gre_keymap_flush(void)
{
struct list_head *pos, *n;
struct nf_ct_gre_keymap *km, *tmp;

write_lock_bh(&nf_ct_gre_lock);
list_for_each_safe(pos, n, &gre_keymap_list) {
list_del(pos);
kfree(pos);
list_for_each_entry_safe(km, tmp, &gre_keymap_list, list) {
list_del(&km->list);
kfree(km);
}
write_unlock_bh(&nf_ct_gre_lock);
}
Expand Down

0 comments on commit 51807e9

Please sign in to comment.