qcacld-3.0: Fix memory leak at BMI initializing

Free buffered file name when failed at BMI initializing.

CRs-Fixed: 2173026
Change-Id: I5fb1e9c76ba88711a0b0a6395a1ec7ae93ec4415
This commit is contained in:
Zhang Qian 2018-01-17 18:13:05 +08:00 • committed by snandini
commit e0cb936d1f

View file

@ -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.
*
@ -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;
int status = EOK;
const char *filename = NULL;
const char *filename;
const struct firmware *fw_entry;
uint32_t fw_entry_size;
uint8_t *temp_eeprom;
@ -342,7 +342,8 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
if (status) {
BMI_ERR("%s: Failed to get %s", __func__, filename);
return -ENOENT;
status = -ENOENT;
goto release_fw;
}
if (!fw_entry || !fw_entry->data) {
@ -503,8 +504,10 @@ release_fw:
release_firmware(fw_entry);
for (i = 0; i < bd_files; i++) {
qdf_mem_free(bd_id_filename[i]);
bd_id_filename[i] = NULL;
if (bd_id_filename[i]) {
qdf_mem_free(bd_id_filename[i]);
bd_id_filename[i] = NULL;
}
}
if (status != EOK)