Skip to content

Commit

Permalink
mctp: Fix check for dev_hard_header() result
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mkj authored and davem330 committed Apr 1, 2022
1 parent 4298a62 commit 60be976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mctp/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 60be976

Please sign in to comment.