summaryrefslogtreecommitdiff
path: root/net/sctp/sctp_diag.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-06-29 14:27:39 +0200
committerLinus Walleij <linus.walleij@linaro.org>2017-06-29 14:27:39 +0200
commit61830619675b97d3da34c59c71ae51646a205e2c (patch)
treee6d39f81284bdb86ba4214c89994fb454074f583 /net/sctp/sctp_diag.c
parent8137f78a7fedeef1ffc0ac36e0ad68960eaf5010 (diff)
parentc0bc126f97fb929b3ae02c1c62322645d70eb408 (diff)
downloadlinux-61830619675b97d3da34c59c71ae51646a205e2c.tar.gz
linux-61830619675b97d3da34c59c71ae51646a205e2c.tar.xz
Merge tag 'v4.12-rc7' into devel
Linux 4.12-rc7
Diffstat (limited to 'net/sctp/sctp_diag.c')
-rw-r--r--net/sctp/sctp_diag.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c
index 048954eee984..9a647214a91e 100644
--- a/net/sctp/sctp_diag.c
+++ b/net/sctp/sctp_diag.c
@@ -278,7 +278,6 @@ out:
static int sctp_sock_dump(struct sock *sk, void *p)
{
- struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_comm_param *commp = p;
struct sk_buff *skb = commp->skb;
struct netlink_callback *cb = commp->cb;
@@ -287,7 +286,9 @@ static int sctp_sock_dump(struct sock *sk, void *p)
int err = 0;
lock_sock(sk);
- list_for_each_entry(assoc, &ep->asocs, asocs) {
+ if (!sctp_sk(sk)->ep)
+ goto release;
+ list_for_each_entry(assoc, &sctp_sk(sk)->ep->asocs, asocs) {
if (cb->args[4] < cb->args[1])
goto next;