Thread (6 messages) 6 messages, 4 authors, 2026-06-17

Re: [PATCH net-next v2] net: dsa: Fix skb ownership in taggers

From: Qingfang Deng <hidden>
Date: 2026-06-17 02:23:06

On 16 Jun 2026 at 11:36:22 +0200, Linus Walleij wrote:
quoted hunk ↗ jump to hunk
--- a/net/dsa/tag_rtl4_a.c
+++ b/net/dsa/tag_rtl4_a.c
@@ -41,8 +41,10 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb,
 	u16 out;
 
 	/* Pad out to at least 60 bytes */
-	if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false)))
+	if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false))) {
+		kfree_skb(skb);
 		return NULL;
+	}
This can be simplified to eth_skb_pad().
quoted hunk ↗ jump to hunk
 
 	netdev_dbg(dev, "add realtek tag to package to port %d\n",
 		   dp->index);
--- a/net/dsa/tag_rzn1_a5psw.c
+++ b/net/dsa/tag_rzn1_a5psw.c
@@ -48,7 +48,7 @@ static struct sk_buff *a5psw_tag_xmit(struct sk_buff *skb, struct net_device *de
 	 * least 60 bytes otherwise they will be discarded when they enter the
 	 * switch port logic.
 	 */
-	if (__skb_put_padto(skb, ETH_ZLEN, false))
+	if (skb_put_padto(skb, ETH_ZLEN))
 		return NULL;
Same here.
 
 	/* provide 'A5PSW_TAG_LEN' bytes additional space */
- Qingfang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help