2020-04-27 10:47:58

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH net-next] ath11k: fix error return code in ath11k_dp_alloc()

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: d0998eb84ed3 ("ath11k: optimise ath11k_dp_tx_completion_handler")
Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/net/wireless/ath/ath11k/dp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 50350f77b309..2f35d325f7a5 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -909,8 +909,10 @@ int ath11k_dp_alloc(struct ath11k_base *ab)
dp->tx_ring[i].tx_status_head = 0;
dp->tx_ring[i].tx_status_tail = DP_TX_COMP_RING_SIZE - 1;
dp->tx_ring[i].tx_status = kmalloc(size, GFP_KERNEL);
- if (!dp->tx_ring[i].tx_status)
+ if (!dp->tx_ring[i].tx_status) {
+ ret = -ENOMEM;
goto fail_cmn_srng_cleanup;
+ }
}

for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++)




2020-05-04 09:07:54

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH net-next] ath11k: fix error return code in ath11k_dp_alloc()

Wei Yongjun <[email protected]> wrote:

> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: d0998eb84ed3 ("ath11k: optimise ath11k_dp_tx_completion_handler")
> Signed-off-by: Wei Yongjun <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

f76f750aeea4 ath11k: fix error return code in ath11k_dp_alloc()

--
https://patchwork.kernel.org/patch/11511849/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches