diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-06 06:13:18 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-06 06:13:18 (GMT) |
commit | 2c10c22af088ab5d94fae93ce3fe6436b2a208b4 (patch) | |
tree | db27721001f194327ddbdcd6c983c4ec68b77c00 /net/key/af_key.c | |
parent | f6121f4f8708195e88cbdf8dd8d171b226b3f858 (diff) | |
parent | fec6ed1d1f9b78a6acb4a3eb2c46c812ac2e96f0 (diff) | |
download | linux-fsl-qoriq-2c10c22af088ab5d94fae93ce3fe6436b2a208b4.tar.xz |
Merge branch 'linus' into sched/devel
Diffstat (limited to 'net/key/af_key.c')
-rw-r--r-- | net/key/af_key.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index d628df9..b7f5a1c 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -73,22 +73,18 @@ static int pfkey_can_dump(struct sock *sk) return 0; } -static int pfkey_do_dump(struct pfkey_sock *pfk) +static void pfkey_terminate_dump(struct pfkey_sock *pfk) { - int rc; - - rc = pfk->dump.dump(pfk); - if (rc == -ENOBUFS) - return 0; - - pfk->dump.done(pfk); - pfk->dump.dump = NULL; - pfk->dump.done = NULL; - return rc; + if (pfk->dump.dump) { + pfk->dump.done(pfk); + pfk->dump.dump = NULL; + pfk->dump.done = NULL; + } } static void pfkey_sock_destruct(struct sock *sk) { + pfkey_terminate_dump(pfkey_sk(sk)); skb_queue_purge(&sk->sk_receive_queue); if (!sock_flag(sk, SOCK_DEAD)) { @@ -310,6 +306,18 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, return err; } +static int pfkey_do_dump(struct pfkey_sock *pfk) +{ + int rc; + + rc = pfk->dump.dump(pfk); + if (rc == -ENOBUFS) + return 0; + + pfkey_terminate_dump(pfk); + return rc; +} + static inline void pfkey_hdr_dup(struct sadb_msg *new, struct sadb_msg *orig) { *new = *orig; |