summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-07-04 00:52:49 +0900
committerDavid S. Miller <davem@davemloft.net>2013-07-03 17:40:58 -0700
commita1bdc45580fc19e968b32ad27cd7e476a4aa58f6 (patch)
tree3070be32b3c47b7406b7cbc8c91c73400e535cf7 /net/ipv6
parent36b7bfe09b6deb71bf387852465245783c9a6208 (diff)
downloadlinux-stable-a1bdc45580fc19e968b32ad27cd7e476a4aa58f6.tar.gz
linux-stable-a1bdc45580fc19e968b32ad27cd7e476a4aa58f6.tar.bz2
linux-stable-a1bdc45580fc19e968b32ad27cd7e476a4aa58f6.zip
net: ipv6: add missing lock in ping_v6_sendmsg
Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ping.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 2b52046e1263..10b975577e91 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -174,6 +174,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);
+ lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,
0, hlimit,
np->tclass, NULL, &fl6, rt,
@@ -188,6 +189,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
(struct icmp6hdr *) &pfh.icmph,
len);
}
+ release_sock(sk);
return err;
}