summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath11k/qmi.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2020-11-24 17:59:16 +0200
committerKalle Valo <kvalo@codeaurora.org>2020-12-02 20:20:16 +0200
commite7bcc145bcd035e56da7b97b033c463b32a5ff80 (patch)
tree07b9237d25e99a85b0ceaf3691dd1474c95e4b43 /drivers/net/wireless/ath/ath11k/qmi.c
parentd35d1375493b0f962a5da5aef015b8bd215e059d (diff)
ath11k: Fix an error handling path
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> Link: https://lore.kernel.org/r/20201122173943.1366167-1-christophe.jaillet@wanadoo.fr
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/qmi.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/qmi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index 8529b3328d24..d128c335bf5b 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -1591,15 +1591,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;