summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-04-05 10:49:49 -0500
committerKalle Valo <kvalo@codeaurora.org>2018-04-25 11:25:36 +0300
commit3763770044640caeb1101cdea40697cc0814403c (patch)
tree090cd01cc4f6112cc3a4e6e8a5b1b14f467f05df
parent9d81ecde4dce37cd9e147c24c9bc0cd1d4c259d5 (diff)
downloadtalos-op-linux-3763770044640caeb1101cdea40697cc0814403c.tar.gz
talos-op-linux-3763770044640caeb1101cdea40697cc0814403c.zip
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: c3b2f7ca4186 ("qtnfmac: implement asynchronous firmware loading") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
index f117904d9120..6c1e139bb8f7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
@@ -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,
QTN_FW_DL_TIMEOUT_MS)) {
pr_err("card is not ready\n");
+
+ if (!flashboot)
+ release_firmware(fw);
+
goto fw_load_fail;
}
OpenPOWER on IntegriCloud