aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2005-11-09 20:25:52 -0500
committerThomas Graf <tgr@axs.localdomain>2005-11-09 20:26:40 -0500
commita8f74b228826eef1cbe04a05647d61e896f5fd63 (patch)
tree6abffeafca83f1aa342ed905367fab1f5a1ac554 /net/netlink/af_netlink.c
parentbfa83a9e03cf8d501c6272999843470afecb32ed (diff)
[NETLINK]: Make netlink_callback->done() optional
Most netlink families make no use of the done() callback, making it optional gets rid of all unnecessary dummy implementations. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
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