Skip to content

Commit

Permalink
ath11k: Fix an error handling path
Browse files Browse the repository at this point in the history
If 'kzalloc' fails, we must return an error code.

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

Fixes: d5c6515 ("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
  • Loading branch information
tititiou36 authored and Kalle Valo committed Dec 2, 2020
1 parent d35d137 commit e7bcc14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/wireless/ath/ath11k/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e7bcc14

Please sign in to comment.