Skip to content

Commit 80c8eae

Browse files
Satanand Burladavem330
authored andcommitted
liquidio: Avoid accessing skb after submitting to input queue
Accessing skb after submitting to input queue can cause access to stale pointers if the skb ends up being transmitted and freed by that time. Signed-off-by: Satanand Burla <[email protected]> Signed-off-by: Derek Chickles <[email protected]> Signed-off-by: Raghu Vatsavayi <[email protected]> Signed-off-by: Felix Manlunas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 49b3eb7 commit 80c8eae

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,11 +3316,11 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
33163316

33173317
netif_trans_update(netdev);
33183318

3319-
if (skb_shinfo(skb)->gso_size)
3320-
stats->tx_done += skb_shinfo(skb)->gso_segs;
3319+
if (tx_info->s.gso_segs)
3320+
stats->tx_done += tx_info->s.gso_segs;
33213321
else
33223322
stats->tx_done++;
3323-
stats->tx_tot_bytes += skb->len;
3323+
stats->tx_tot_bytes += ndata.datasize;
33243324

33253325
return NETDEV_TX_OK;
33263326

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,11 +2433,11 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
24332433

24342434
netif_trans_update(netdev);
24352435

2436-
if (skb_shinfo(skb)->gso_size)
2437-
stats->tx_done += skb_shinfo(skb)->gso_segs;
2436+
if (tx_info->s.gso_segs)
2437+
stats->tx_done += tx_info->s.gso_segs;
24382438
else
24392439
stats->tx_done++;
2440-
stats->tx_tot_bytes += skb->len;
2440+
stats->tx_tot_bytes += ndata.datasize;
24412441

24422442
return NETDEV_TX_OK;
24432443

0 commit comments

Comments
 (0)