diff options
author | Dave Jones <davej@codemonkey.org.uk> | 2016-12-28 19:53:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-29 20:05:49 +0300 |
commit | de8499cee59465cfa6135591d665a065539d456b (patch) | |
tree | 90eb087c9d14608f00b4888126dc8b564b8e1bfd /net/ipv6/ping.c | |
parent | 9eb12474787d32a968b5b01ecbf83acd2d230b25 (diff) | |
download | linux-de8499cee59465cfa6135591d665a065539d456b.tar.xz |
ipv6: remove unnecessary inet6_sk check
np is already assigned in the variable declaration of ping_v6_sendmsg.
At this point, we have already dereferenced np several times, so the
NULL check is also redundant.
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ping.c')
-rw-r--r-- | net/ipv6/ping.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index e1f8b34d7a2e..9b522fa90e6d 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c @@ -126,12 +126,6 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) return PTR_ERR(dst); rt = (struct rt6_info *) dst; - np = inet6_sk(sk); - if (!np) { - err = -EBADF; - goto dst_err_out; - } - if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) fl6.flowi6_oif = np->mcast_oif; else if (!fl6.flowi6_oif) @@ -166,7 +160,6 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) } release_sock(sk); -dst_err_out: dst_release(dst); if (err) |