aboutsummaryrefslogtreecommitdiff
path: root/net/key
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-09 00:17:25 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-09 00:17:25 +0200
commitcdbb92b31d3c465aa96bd09f2d42c39b87b32bee (patch)
tree370e29681529882d7e4c766a19f0612885583464 /net/key
parent2ec2b482b10a1ed3493c224f1893cddd3d33833b (diff)
parent69849375d6b13e94d08cdc94b49b11fbab454a0e (diff)
Merge branch 'linus' into core/rcu
Diffstat (limited to 'net/key')
-rw-r--r--net/key/af_key.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c
index d628df97e02..b7f5a1c353e 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;