[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220401024844.1578937-2-matt@codeconstruct.com.au>
Date: Fri, 1 Apr 2022 10:48:42 +0800
From: Matt Johnston <matt@...econstruct.com.au>
To: netdev@...r.kernel.org
Cc: mjrinal@...lemson.edu, jk@...econstruct.com.au,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Subject: [PATCH net 1/3] 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@...econstruct.com.au>
---
net/mctp/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.32.0
Powered by blists - more mailing lists