linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath11k: Fix an error handling path
@ 2020-11-22 17:39 Christophe JAILLET
  2020-12-02 18:20 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2020-11-22 17:39 UTC (permalink / raw)
  To: kvalo, davem, kuba, gseset, mkenna, slakkavalli, gsamin, pradeepc
  Cc: ath11k, linux-wireless, netdev, linux-kernel, kernel-janitors,
	Christophe JAILLET

If 'kzalloc' fails, we must return an error code.

While at it, remove a useless initialization of 'err' which could hide the
issue.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index c2b165158225..99a88ca83dea 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -1585,15 +1585,17 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab)
 	struct qmi_wlanfw_ind_register_resp_msg_v01 *resp;
 	struct qmi_handle *handle = &ab->qmi.handle;
 	struct qmi_txn txn;
-	int ret = 0;
+	int ret;
 
 	req = kzalloc(sizeof(*req), GFP_KERNEL);
 	if (!req)
 		return -ENOMEM;
 
 	resp = kzalloc(sizeof(*resp), GFP_KERNEL);
-	if (!resp)
+	if (!resp) {
+		ret = -ENOMEM;
 		goto resp_out;
+	}
 
 	req->client_id_valid = 1;
 	req->client_id = QMI_WLANFW_CLIENT_ID;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath11k: Fix an error handling path
  2020-11-22 17:39 [PATCH] ath11k: Fix an error handling path Christophe JAILLET
@ 2020-12-02 18:20 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-12-02 18:20 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: davem, kuba, gseset, mkenna, slakkavalli, gsamin, pradeepc,
	ath11k, linux-wireless, netdev, linux-kernel, kernel-janitors,
	Christophe JAILLET

Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> If 'kzalloc' fails, we must return an error code.
> 
> While at it, remove a useless initialization of 'err' which could hide the
> issue.
> 
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

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

e7bcc145bcd0 ath11k: Fix an error handling path

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201122173943.1366167-1-christophe.jaillet@wanadoo.fr/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-02 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-22 17:39 [PATCH] ath11k: Fix an error handling path Christophe JAILLET
2020-12-02 18:20 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).