aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 5ca283537bc6..f3fb7e575816 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -427,7 +427,8 @@ static int netlink_release(struct socket *sock)
427 427
428 spin_lock(&nlk->cb_lock); 428 spin_lock(&nlk->cb_lock);
429 if (nlk->cb) { 429 if (nlk->cb) {
430 nlk->cb->done(nlk->cb); 430 if (nlk->cb->done)
431 nlk->cb->done(nlk->cb);
431 netlink_destroy_callback(nlk->cb); 432 netlink_destroy_callback(nlk->cb);
432 nlk->cb = NULL; 433 nlk->cb = NULL;
433 } 434 }
@@ -1322,7 +1323,8 @@ static int netlink_dump(struct sock *sk)
1322 skb_queue_tail(&sk->sk_receive_queue, skb); 1323 skb_queue_tail(&sk->sk_receive_queue, skb);
1323 sk->sk_data_ready(sk, skb->len); 1324 sk->sk_data_ready(sk, skb->len);
1324 1325
1325 cb->done(cb); 1326 if (cb->done)
1327 cb->done(cb);
1326 nlk->cb = NULL; 1328 nlk->cb = NULL;
1327 spin_unlock(&nlk->cb_lock); 1329 spin_unlock(&nlk->cb_lock);
1328 1330