diff mbox series

ath11k: cleanup reo command error code overwritten

Message ID 1586776872-25766-1-git-send-email-gsamin@codeaurora.org (mailing list archive)
State Accepted
Commit e190bc05b191ff62157ca63322aedd14c7e87d32
Delegated to: Kalle Valo
Headers show
Series ath11k: cleanup reo command error code overwritten | expand

Commit Message

Govindaraj Saminathan April 13, 2020, 11:21 a.m. UTC
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>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Kalle Valo April 15, 2020, 8:04 a.m. UTC | #1
Govindaraj Saminathan <gsamin@codeaurora.org> wrote:

> 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>

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

e190bc05b191 ath11k: cleanup reo command error code overwritten
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 7aac4b0..6f40e72 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)