summaryrefslogtreecommitdiff
path: root/net/mctp/route.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@codeconstruct.com.au>2022-04-01 10:48:42 +0800
committerDavid S. Miller <davem@davemloft.net>2022-04-01 12:04:15 +0100
commit60be976ac45137657b7b505d7e0d44d0e51accb7 (patch)
tree74bb288425b7047cbb64504509d65035d8727c41 /net/mctp/route.c
parent4298a62ff894b5b3b3e6545b2aa6dcbcfdc69be1 (diff)
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: 889b7da23abf ("mctp: Add initial routing framework") Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mctp/route.c')
-rw-r--r--net/mctp/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mctp/route.c b/net/mctp/route.c
index d5e7db83fe9d..ee548c46c78f 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -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;
}