Commit 37637700 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo

qtnfmac: pearl: pcie: fix memory leak in qtnf_fw_work_handler

In case memory resources for fw were succesfully allocated, release
them before jumping to fw_load_fail.

Addresses-Coverity-ID: 1466092 ("Resource leak")
Fixes: c3b2f7ca ("qtnfmac: implement asynchronous firmware loading")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9d81ecde
...@@ -1185,6 +1185,10 @@ static void qtnf_fw_work_handler(struct work_struct *work) ...@@ -1185,6 +1185,10 @@ static void qtnf_fw_work_handler(struct work_struct *work)
if (qtnf_poll_state(&priv->bda->bda_ep_state, QTN_EP_FW_LOADRDY, if (qtnf_poll_state(&priv->bda->bda_ep_state, QTN_EP_FW_LOADRDY,
QTN_FW_DL_TIMEOUT_MS)) { QTN_FW_DL_TIMEOUT_MS)) {
pr_err("card is not ready\n"); pr_err("card is not ready\n");
if (!flashboot)
release_firmware(fw);
goto fw_load_fail; goto fw_load_fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment