Skip to content

Commit

Permalink
nrf_wifi: Fix a buffer free issue for raw tx packet transmit done
Browse files Browse the repository at this point in the history
A recent fix to update statistics covered the txbuffer done process
in an if-else check. This prevents tx buffers from being released
on tx failure. place the status check to only update error
statistics and remove txdone API from if check.

Fixes SHEL-2448 for driver

Signed-off-by: Vivekananda Uppunda <[email protected]>
  • Loading branch information
VivekUppunda committed Feb 27, 2024
1 parent b02a54c commit 9804eee
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions nrf_wifi/fw_if/umac_if/src/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,20 +1454,21 @@ enum nrf_wifi_status nrf_wifi_fmac_rawtx_done_event_process(

nrf_wifi_osal_spinlock_take(fmac_dev_ctx->fpriv->opriv,
def_dev_ctx->tx_config.tx_lock);
if (!config->status) {
status = tx_done_process(fmac_dev_ctx,
config->desc_num);

if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Process raw tx done failed",
__func__);
goto unlock;
}
} else {
if (!config->status) {
/* Increment raw TX failure count */
def_dev_ctx->raw_pkt_stats.raw_pkt_send_failure += 1;
}

status = tx_done_process(fmac_dev_ctx,
config->desc_num);

if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Process raw tx done failed",
__func__);
goto unlock;
}
unlock:
nrf_wifi_osal_spinlock_rel(fmac_dev_ctx->fpriv->opriv,
def_dev_ctx->tx_config.tx_lock);
Expand Down

0 comments on commit 9804eee

Please sign in to comment.