Skip to contentSkip to conversation

cxgb4: add missing release on skb in uld_send()

PATCH In review Navid Emamdoost 2 participants 6 messages Jul 18, 2020 – Jul 23, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: add missing release on skb in uld_send()

In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP.

---
 drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -0
index 32a45dc51ed7..d8c37fd4b808 100644
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
 	txq_info = adap->sge.uld_txq_info[tx_uld_type];
 	if (unlikely(!txq_info)) {
 		WARN_ON(true);
+		consume_skb(skb);
 		return NET_XMIT_DROP;
 	}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

From: Navid Emamdoost <[email protected]>
Date: Sat, 18 Jul 2020 00:18:43 -0500

drivers/net/ethernet/chelsio/cxgb4/sge.c static inline int uld_send(struct adapter *adap, struct sk_buff *skb, · line 2944

Quoted 12 lines
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -0
index 32a45dc51ed7..d8c37fd4b808 100644
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
 	txq_info = adap->sge.uld_txq_info[tx_uld_type];
 	if (unlikely(!txq_info)) {
 		WARN_ON(true);
+		consume_skb(skb);
 		return NET_XMIT_DROP;
 	}
 

This is a packet drop so kfree_skb() is more appropriate here.

#2 lore raw

PATCH v2 1/1 cxgb4: add missing release on skb in uld_send()

In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP.

---
changes in v2:
- using kfree_skb() based on David Miller suggestion.

---
 drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -1
index d8c37fd4b808..92eee66cbc84 100644
@@ -2938,7 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
 	txq_info = adap->sge.uld_txq_info[tx_uld_type];
 	if (unlikely(!txq_info)) {
 		WARN_ON(true);
-		consume_skb(skb);
+		kfree_skb(skb);
 		return NET_XMIT_DROP;
 	}
 
Signature · 1 line
2.17.1
maintainer
#3 lore raw

From: Navid Emamdoost <[email protected]>
Date: Wed, 22 Jul 2020 13:57:21 -0500

Quoted 7 lines

In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP.

---
changes in v2:
- using kfree_skb() based on David Miller suggestion.

This doesn't apply to any of my networking GIT trees.

Please base this on either 'net' or 'net-next' as appropriate, and indicate this in your Subject line f.e. "[PATCH net v2] ..."

Thank you.

#4 lore raw

PATCH v3 1/1 cxgb4: add missing release on skb in uld_send()

In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP.

---
v3:
- fixed the base problem, and used kfree_skb

---
 drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -0
index 32a45dc51ed7..92eee66cbc84 100644
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
 	txq_info = adap->sge.uld_txq_info[tx_uld_type];
 	if (unlikely(!txq_info)) {
 		WARN_ON(true);
+		kfree_skb(skb);
 		return NET_XMIT_DROP;
 	}
 
Signature · 1 line
2.17.1