summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGovindaraj Saminathan <gsamin@codeaurora.org>2020-04-13 16:51:12 +0530
committerKalle Valo <kvalo@codeaurora.org>2020-04-15 11:03:48 +0300
commite190bc05b191ff62157ca63322aedd14c7e87d32 (patch)
tree3fc7f167881c999a5bbf5738bc3601988ca44161
parent8a7968bee8d08835caa0d7bc0c25d750a5b52389 (diff)
ath11k: cleanup reo command error code overwritten
should not overwrite the error code. No buffer available then return invalid. For other failures return the error code of actual failure. Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1586776872-25766-1-git-send-email-gsamin@codeaurora.org
-rw-r--r--drivers/net/wireless/ath/ath11k/dp_tx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 7aac4b0eea0c..6f40e72f41e6 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -543,8 +543,12 @@ int ath11k_dp_tx_send_reo_cmd(struct ath11k_base *ab, struct dp_rx_tid *rx_tid,
cmd_ring = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id];
cmd_num = ath11k_hal_reo_cmd_send(ab, cmd_ring, type, cmd);
+ /* cmd_num should start from 1, during failure return the error code */
+ if (cmd_num < 0)
+ return cmd_num;
+
/* reo cmd ring descriptors has cmd_num starting from 1 */
- if (cmd_num <= 0)
+ if (cmd_num == 0)
return -EINVAL;
if (!cb)