]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mctp: Fix check for dev_hard_header() result
authorMatt Johnston <matt@codeconstruct.com.au>
Fri, 1 Apr 2022 02:48:42 +0000 (10:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Apr 2022 11:04:15 +0000 (12:04 +0100)
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>
net/mctp/route.c

index d5e7db83fe9d30f8912164b3d0745413c438e981..ee548c46c78f8e1ff77e223cae65ac3aed428f6b 100644 (file)
@@ -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;
        }