Skip to content

Commit 71d28e5

Browse files
mkjgregkh
authored andcommitted
mctp: Fix check for dev_hard_header() result
[ Upstream commit 60be976 ] dev_hard_header() returns the length of the header, so we need to test for negative errors rather than non-zero. Fixes: 889b7da ("mctp: Add initial routing framework") Signed-off-by: Matt Johnston <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 40229b2 commit 71d28e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mctp/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb)
396396

397397
rc = dev_hard_header(skb, skb->dev, ntohs(skb->protocol),
398398
daddr, skb->dev->dev_addr, skb->len);
399-
if (rc) {
399+
if (rc < 0) {
400400
kfree_skb(skb);
401401
return -EHOSTUNREACH;
402402
}

0 commit comments

Comments
 (0)