Skip to content

Commit 5945a3f

Browse files
ubiedakartben
authored andcommitted
ethernet: nxp: Scrub tx_header
As it's not being used anywhere in the driver. Moreover, the extra unref would trigger a double-free assert (#94311); which is what motivated this cleanup. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 9e7313d commit 5945a3f

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

drivers/ethernet/eth_nxp_enet_qos/eth_nxp_enet_qos_mac.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,7 @@ static int eth_nxp_enet_qos_tx(const struct device *dev, struct net_pkt *pkt)
131131
k_thread_name_get(k_current_get()));
132132

133133
net_pkt_ref(pkt);
134-
135134
data->tx.pkt = pkt;
136-
/* Need to save the header because the ethernet stack
137-
* otherwise discards it from the packet after this call
138-
*/
139-
data->tx.tx_header = pkt->frags;
140135

141136
LOG_DBG("Setting up TX descriptors for packet %p", pkt);
142137

@@ -197,8 +192,6 @@ static void tx_dma_done(const struct device *dev)
197192
net_pkt_frag_unref(fragment);
198193
fragment = fragment->frags;
199194
}
200-
201-
net_pkt_frag_unref(data->tx.tx_header);
202195
net_pkt_unref(pkt);
203196

204197
eth_stats_update_pkts_tx(data->iface);

drivers/ethernet/eth_nxp_enet_qos/nxp_enet_qos_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ struct nxp_enet_qos_mac_config {
106106
struct nxp_enet_qos_tx_data {
107107
struct k_sem tx_sem;
108108
struct net_pkt *pkt;
109-
struct net_buf *tx_header;
110109
volatile union nxp_enet_qos_tx_desc descriptors[NUM_TX_BUFDESC];
111110
};
112111

0 commit comments

Comments
 (0)