Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: mctp i3c: Copy headers if cloned

Use skb_cow_head() prior to modifying the tx skb. This is necessary
when the skb has been cloned, to avoid modifying other shared clones.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Fixes: c8755b29b58e ("mctp i3c: MCTP I3C driver")
Link: https://patch.msgid.link/20250306-matt-i3c-cow-head-v1-1-d5e6a5495227@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Matt Johnston and committed by
Jakub Kicinski
26db9c9e dc5340c3

+5
+5
drivers/net/mctp/mctp-i3c.c
··· 506 506 const void *saddr, unsigned int len) 507 507 { 508 508 struct mctp_i3c_internal_hdr *ihdr; 509 + int rc; 509 510 510 511 if (!daddr || !saddr) 511 512 return -EINVAL; 513 + 514 + rc = skb_cow_head(skb, sizeof(struct mctp_i3c_internal_hdr)); 515 + if (rc) 516 + return rc; 512 517 513 518 skb_push(skb, sizeof(struct mctp_i3c_internal_hdr)); 514 519 skb_reset_mac_header(skb);