Skip to content

Commit cf7ee25

Browse files
mkjPaolo Abeni
authored andcommitted
mctp i3c: handle NULL header address
daddr can be NULL if there is no neighbour table entry present, in that case the tx packet should be dropped. saddr will usually be set by MCTP core, but check for NULL in case a packet is transmitted by a different protocol. Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Fixes: c8755b2 ("mctp i3c: MCTP I3C driver") Link: https://patch.msgid.link/20250304-mctp-i3c-null-v1-1-4416bbd56540@codeconstruct.com.au Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent ccc2f5a commit cf7ee25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/mctp/mctp-i3c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ static int mctp_i3c_header_create(struct sk_buff *skb, struct net_device *dev,
507507
{
508508
struct mctp_i3c_internal_hdr *ihdr;
509509

510+
if (!daddr || !saddr)
511+
return -EINVAL;
512+
510513
skb_push(skb, sizeof(struct mctp_i3c_internal_hdr));
511514
skb_reset_mac_header(skb);
512515
ihdr = (void *)skb_mac_header(skb);

0 commit comments

Comments
 (0)