summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-12-21 15:06:20 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-21 15:06:20 -0800
commitce28bb4453880759c5bdc2751629f1a865ea4a6e (patch)
tree549617a3c6ffb55402cb403b1d808a11e113b294 /net/ipv4
parent64935310f2fc0128373bbbcfb5b8b49fd26e2ae8 (diff)
parent6cafab50eea327e0d198cc9579a60440fc959756 (diff)
downloadlinux-ce28bb4453880759c5bdc2751629f1a865ea4a6e.tar.gz
linux-ce28bb4453880759c5bdc2751629f1a865ea4a6e.tar.bz2
linux-ce28bb4453880759c5bdc2751629f1a865ea4a6e.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_diag.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 4e5bc4b2f14e..1a4e9ff02762 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -998,7 +998,9 @@ next_chunk:
if (!inet_diag_bc_sk(bc, sk))
goto next_normal;
- sock_hold(sk);
+ if (!refcount_inc_not_zero(&sk->sk_refcnt))
+ goto next_normal;
+
num_arr[accum] = num;
sk_arr[accum] = sk;
if (++accum == SKARR_SZ)