提交 4a36702e 编写于 作者: M Miao Xie 提交者: David S. Miller

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: NMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e93dc489
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册