qcacld-3.0: Fix ref count leak in set hw mode function

In set hw mode function, Vdev reference count is not
freed in all error paths, and it causes leak in
the system.
Release the vdev ref count in all error handling
path.

Change-Id: Ib63a00c1cb601937925b49064719078b7e9a57d1
CRs-Fixed: 2140442
This commit is contained in:
Kabilan Kannan
2017-11-08 18:22:51 -08:00
committed by snandini
vanhempi 040aeec14b
commit bfa9220002

Näytä tiedosto

@@ -166,18 +166,18 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
entry = csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK); entry = csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK);
if (!entry) { if (!entry) {
sme_err("No cmd found in active list"); sme_err("No cmd found in active list");
return QDF_STATUS_E_FAILURE; goto error_path;
} }
command = GET_BASE_ADDR(entry, tSmeCmd, Link); command = GET_BASE_ADDR(entry, tSmeCmd, Link);
if (!command) { if (!command) {
sme_err("Base address is NULL"); sme_err("Base address is NULL");
return QDF_STATUS_E_FAILURE; goto error_path;
} }
if (e_sme_command_set_hw_mode != command->command) { if (e_sme_command_set_hw_mode != command->command) {
sme_err("Command mismatch!"); sme_err("Command mismatch!");
return QDF_STATUS_E_FAILURE; goto error_path;
} }
callback = command->u.set_hw_mode_cmd.set_hw_mode_cb; callback = command->u.set_hw_mode_cmd.set_hw_mode_cb;
@@ -239,6 +239,11 @@ end:
csr_release_command(mac, command); csr_release_command(mac, command);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
error_path:
wlan_objmgr_vdev_release_ref(command->u.set_hw_mode_cmd.vdev,
WLAN_LEGACY_SME_ID);
return QDF_STATUS_E_FAILURE;
} }
/** /**