提交 60be976a 编写于 作者: M Matt Johnston 提交者: David S. Miller

mctp: Fix check for dev_hard_header() result

dev_hard_header() returns the length of the header, so
we need to test for negative errors rather than non-zero.

Fixes: 889b7da2 ("mctp: Add initial routing framework")
Signed-off-by: NMatt Johnston <matt@codeconstruct.com.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4298a62f
......@@ -512,7 +512,7 @@ static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb)
rc = dev_hard_header(skb, skb->dev, ntohs(skb->protocol),
daddr, skb->dev->dev_addr, skb->len);
if (rc) {
if (rc < 0) {
kfree_skb(skb);
return -EHOSTUNREACH;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册