提交 4c23d874 编写于 作者: A Andrzej Hajda 提交者: Marcel Holtmann

6lowpan: fix error checking code

Bool variable 'fail' is always non-negative, it indicates an error if it
is true.

The problem has been detected using coccinelle script
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com>
Acked-by: NAlexander Aring <aar@pengutronix.de>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 8790404d
...@@ -482,7 +482,7 @@ static int lowpan_uncompress_multicast_ctx_daddr(struct sk_buff *skb, ...@@ -482,7 +482,7 @@ static int lowpan_uncompress_multicast_ctx_daddr(struct sk_buff *skb,
ipaddr->s6_addr[0] = 0xFF; ipaddr->s6_addr[0] = 0xFF;
fail = lowpan_fetch_skb(skb, &ipaddr->s6_addr[1], 2); fail = lowpan_fetch_skb(skb, &ipaddr->s6_addr[1], 2);
fail |= lowpan_fetch_skb(skb, &ipaddr->s6_addr[12], 4); fail |= lowpan_fetch_skb(skb, &ipaddr->s6_addr[12], 4);
if (fail < 0) if (fail)
return -EIO; return -EIO;
/* take prefix_len and network prefix from the context */ /* take prefix_len and network prefix from the context */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册