If its a last packet and fin is set. Make sure FIN is informed
to HW before skb gets freed.
Fixes: 429765a149f1 ("chcr: handle partial end part of a record")
Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
flags);
goto out;
}
+
+ if (th->fin)
+ skb_get(skb);
}
if (unlikely(tls_record_is_start_marker(record))) {
__skb_frag_unref(&record->frags[i]);
}
/* if any failure, come out from the loop. */
- if (ret)
+ if (ret) {
+ if (th->fin)
+ dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
+ }
/* length should never be less than 0 */
WARN_ON(data_len < 0);
/* tcp finish is set, send a separate tcp msg including all the options
* as well.
*/
- if (th->fin)
+ if (th->fin) {
chcr_ktls_write_tcp_options(tx_info, skb, q, tx_info->tx_chan);
+ dev_kfree_skb_any(skb);
+ }
return NETDEV_TX_OK;
out: