summaryrefslogtreecommitdiffstats
path: root/net/mctp
diff options
context:
space:
mode:
authorMatt Johnston <matt@codeconstruct.com.au>2022-04-01 10:48:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-13 20:59:16 +0200
commit71d28e5073b817189418ddd694e35e08d1c79cf3 (patch)
tree66a14087b0c32bc9166c1e39f007c4f56f0d47e2 /net/mctp
parent40229b2977f1dffa75915ca0a9099427c18063a9 (diff)
downloadlinux-stable-71d28e5073b817189418ddd694e35e08d1c79cf3.tar.gz
linux-stable-71d28e5073b817189418ddd694e35e08d1c79cf3.tar.bz2
linux-stable-71d28e5073b817189418ddd694e35e08d1c79cf3.zip
mctp: Fix check for dev_hard_header() result
[ Upstream commit 60be976ac45137657b7b505d7e0d44d0e51accb7 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/mctp')
-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 fb1bf4ec8529..bbb13dbc9227 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -396,7 +396,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;
}