summaryrefslogtreecommitdiff
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2016-06-02 12:22:30 -0700
committerMax Krummenacher <max.krummenacher@toradex.com>2017-03-15 18:35:46 +0100
commit440ef98ad687b210dca17e5c5141b24738f04922 (patch)
tree036c3507db3d4250cff096e825fc90897e485a3c /net/ipv4/ping.c
parentde1c77640710e1cca36091c8e6d7947bff2397e7 (diff)
parent648d744eff1aedea4ffe49dfca07aa465669e1f4 (diff)
Merge tag 'v4.1.24' into toradex_vf_4.1-next
Linux 4.1.24
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 05ff44b758df..f6ee0d561aab 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -745,8 +745,10 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
if (msg->msg_controllen) {
err = ip_cmsg_send(sock_net(sk), msg, &ipc, false);
- if (err)
+ if (unlikely(err)) {
+ kfree(ipc.opt);
return err;
+ }
if (ipc.opt)
free = 1;
}