Thread (3 messages) 3 messages, 2 authors, 2025-05-13

Re: [PATCH net v2] net: dsa: microchip: linearize skb for tail-tagging switches

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-05-13 23:37:46
Also in: lkml, stable

On Mon, 12 May 2025 16:44:18 +0200 Jakob Unterwurzacher wrote:
quoted hunk ↗ jump to hunk
 static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev)
 {
+	u8 *tag;
+
+	if (skb_linearize(skb))
+		return NULL;
+
 	/* Tag decoding */
-	u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
+	tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
 	unsigned int port = tag[0] & KSZ9477_TAIL_TAG_EG_PORT_M;
 	unsigned int len = KSZ_EGRESS_TAG_LEN;
Please don't add code before variable declarations.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help