diff options
author | Liping Zhang <liping.zhang@spreadtrum.com> | 2016-08-22 21:58:16 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-25 13:11:00 +0200 |
commit | 93fac10b99d78eb2c50a739cba2e590c7332d539 (patch) | |
tree | 6c77b52fae33055b1dd65810111ad98aa604a255 /net/netfilter/nfnetlink_acct.c | |
parent | 89e1f6d2b956649fbe0704d543a90b8e0cf872b0 (diff) | |
download | op-kernel-dev-93fac10b99d78eb2c50a739cba2e590c7332d539.zip op-kernel-dev-93fac10b99d78eb2c50a739cba2e590c7332d539.tar.gz |
netfilter: nfnetlink: use list_for_each_entry_safe to delete all objects
cttimeout and acct objects are deleted from the list while traversing
it, so use list_for_each_entry is unsafe here.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nfnetlink_acct.c')
-rw-r--r-- | net/netfilter/nfnetlink_acct.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index 70eb2f6a..d44d89b 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c @@ -343,12 +343,12 @@ static int nfnl_acct_del(struct net *net, struct sock *nfnl, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const tb[]) { - char *acct_name; - struct nf_acct *cur; + struct nf_acct *cur, *tmp; int ret = -ENOENT; + char *acct_name; if (!tb[NFACCT_NAME]) { - list_for_each_entry(cur, &net->nfnl_acct_list, head) + list_for_each_entry_safe(cur, tmp, &net->nfnl_acct_list, head) nfnl_acct_try_del(cur); return 0; |