qcacld-3.0: Fix memory leak at BMI initializing

Free buffered file name when failed at BMI initializing.

CRs-Fixed: 2173026
Change-Id: I5fb1e9c76ba88711a0b0a6395a1ec7ae93ec4415
此提交包含在:
Zhang Qian
2018-01-17 18:13:05 +08:00
提交者 snandini
父節點 83c86b1b52
當前提交 e0cb936d1f

查看文件

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -182,7 +182,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
{ {
struct hif_opaque_softc *scn = ol_ctx->scn; struct hif_opaque_softc *scn = ol_ctx->scn;
int status = EOK; int status = EOK;
const char *filename = NULL; const char *filename;
const struct firmware *fw_entry; const struct firmware *fw_entry;
uint32_t fw_entry_size; uint32_t fw_entry_size;
uint8_t *temp_eeprom; uint8_t *temp_eeprom;
@@ -342,7 +342,8 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
if (status) { if (status) {
BMI_ERR("%s: Failed to get %s", __func__, filename); BMI_ERR("%s: Failed to get %s", __func__, filename);
return -ENOENT; status = -ENOENT;
goto release_fw;
} }
if (!fw_entry || !fw_entry->data) { if (!fw_entry || !fw_entry->data) {
@@ -503,8 +504,10 @@ release_fw:
release_firmware(fw_entry); release_firmware(fw_entry);
for (i = 0; i < bd_files; i++) { for (i = 0; i < bd_files; i++) {
qdf_mem_free(bd_id_filename[i]); if (bd_id_filename[i]) {
bd_id_filename[i] = NULL; qdf_mem_free(bd_id_filename[i]);
bd_id_filename[i] = NULL;
}
} }
if (status != EOK) if (status != EOK)