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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a808fb1e877d..c8f35b5d2ee9 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1398,7 +1398,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1398 int noblock = flags&MSG_DONTWAIT; 1398 int noblock = flags&MSG_DONTWAIT;
1399 size_t copied; 1399 size_t copied;
1400 struct sk_buff *skb, *data_skb; 1400 struct sk_buff *skb, *data_skb;
1401 int err; 1401 int err, ret;
1402 1402
1403 if (flags&MSG_OOB) 1403 if (flags&MSG_OOB)
1404 return -EOPNOTSUPP; 1404 return -EOPNOTSUPP;
@@ -1461,8 +1461,13 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1461 1461
1462 skb_free_datagram(sk, skb); 1462 skb_free_datagram(sk, skb);
1463 1463
1464 if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) 1464 if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) {
1465 netlink_dump(sk); 1465 ret = netlink_dump(sk);
1466 if (ret) {
1467 sk->sk_err = ret;
1468 sk->sk_error_report(sk);
1469 }
1470 }
1466 1471
1467 scm_recv(sock, msg, siocb->scm, flags); 1472 scm_recv(sock, msg, siocb->scm, flags);
1468out: 1473out:
@@ -1727,6 +1732,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1727 struct netlink_callback *cb; 1732 struct netlink_callback *cb;
1728 struct sock *sk; 1733 struct sock *sk;
1729 struct netlink_sock *nlk; 1734 struct netlink_sock *nlk;
1735 int ret;
1730 1736
1731 cb = kzalloc(sizeof(*cb), GFP_KERNEL); 1737 cb = kzalloc(sizeof(*cb), GFP_KERNEL);
1732 if (cb == NULL) 1738 if (cb == NULL)
@@ -1755,9 +1761,13 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1755 nlk->cb = cb; 1761 nlk->cb = cb;
1756 mutex_unlock(nlk->cb_mutex); 1762 mutex_unlock(nlk->cb_mutex);
1757 1763
1758 netlink_dump(sk); 1764 ret = netlink_dump(sk);
1765
1759 sock_put(sk); 1766 sock_put(sk);
1760 1767
1768 if (ret)
1769 return ret;
1770
1761 /* We successfully started a dump, by returning -EINTR we 1771 /* We successfully started a dump, by returning -EINTR we
1762 * signal not to send ACK even if it was requested. 1772 * signal not to send ACK even if it was requested.
1763 */ 1773 */