All references for frag pages that are obtained in tx_sync_info_get()
should be released.
Release usually occurs in the corresponding CQE of the WQE.
In error flows, not all fragments have a WQE posted for them, hence
no matching CQE will be generated.
For these pages, release the reference in the error flow.
Fixes:
d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
struct tx_sync_info info = {};
u16 contig_wqebbs_room, pi;
u8 num_wqebbs;
- int i;
+ int i = 0;
if (!tx_sync_info_get(priv_tx, seq, &info)) {
/* We might get here if a retransmission reaches the driver
tx_post_resync_params(sq, priv_tx, info.rcd_sn);
- for (i = 0; i < info.nr_frags; i++)
+ for (; i < info.nr_frags; i++)
if (tx_post_resync_dump(sq, &info.frags[i], priv_tx->tisn, !i))
goto err_out;
return skb;
err_out:
+ for (; i < info.nr_frags; i++)
+ put_page(skb_frag_page(&info.frags[i]));
+
dev_kfree_skb_any(skb);
return NULL;
}