From: Lorenzo Colitti Date: Wed, 3 Jul 2013 15:12:40 +0000 (+0900) Subject: net: ipv6: fix wrong ping_v6_sendmsg return value X-Git-Tag: firefly_0821_release~4090^2~399 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2ac994153e3126cc9a011926b63fcd215a2a71c8;p=firefly-linux-kernel-4.4.55.git net: ipv6: fix wrong ping_v6_sendmsg return value [net-next commit fbfe80c890a1dc521d0b629b870e32fcffff0da5] ping_v6_sendmsg currently returns 0 on success. It should return the number of bytes written instead. Bug: 12800827 Change-Id: I7ed17dc61afbb68a84908e67e44db976ec812bad Signed-off-by: Lorenzo Colitti Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index a6462d657c15..1f4886857b44 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c @@ -212,5 +212,8 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, len); } - return err; + if (err) + return err; + + return len; }