summaryrefslogtreecommitdiffstats
path: root/kernel/net/ipv6/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/ipv6/ping.c')
-rw-r--r--kernel/net/ipv6/ping.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/net/ipv6/ping.c b/kernel/net/ipv6/ping.c
index 263a5164a..3e55447b6 100644
--- a/kernel/net/ipv6/ping.c
+++ b/kernel/net/ipv6/ping.c
@@ -150,8 +150,10 @@ int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
rt = (struct rt6_info *) dst;
np = inet6_sk(sk);
- if (!np)
- return -EBADF;
+ if (!np) {
+ err = -EBADF;
+ goto dst_err_out;
+ }
if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
fl6.flowi6_oif = np->mcast_oif;
@@ -186,6 +188,9 @@ int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
}
release_sock(sk);
+dst_err_out:
+ dst_release(dst);
+
if (err)
return err;