From: Miao Xie Date: Wed, 30 Jul 2008 06:57:58 +0000 (-0700) Subject: IPv6: datagram_send_ctl() should exit immediately when an error occured X-Git-Tag: v3.12-rc1~18907^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a36702e016947a0ce6c0c024673bb5b16d3f618;p=kernel%2Fkernel-generic.git IPv6: datagram_send_ctl() should exit immediately when an error occured When an error occured, datagram_send_ctl() should exit immediately rather than continue to run the for loop. Otherwise, the variable err might be changed and the error might be hidden. Fix this bug by using "goto" instead of "break". Signed-off-by: Miao Xie Signed-off-by: David S. Miller --- diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index f7b535d..410046a 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -732,7 +732,7 @@ int datagram_send_ctl(struct net *net, LIMIT_NETDEBUG(KERN_DEBUG "invalid cmsg type: %d\n", cmsg->cmsg_type); err = -EINVAL; - break; + goto exit_f; } }