qcacld-3.0: Release intf addr if failed to open adapter
Release intf addr which is allocated by wlan_hdd_get_intf_addr() to clean up dynamic mac list if failed to open adapter. Change-Id: I3649719496b4f69ce92801d87c05f6af438e5479 CRs-Fixed: 2662240
Cette révision appartient à :
@@ -13133,6 +13133,9 @@ static QDF_STATUS hdd_open_p2p_interface(struct hdd_context *hdd_ctx)
|
||||
"p2p%d",
|
||||
hdd_ctx->p2p_device_address.bytes);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
if (!is_p2p_locally_administered)
|
||||
wlan_hdd_release_intf_addr(hdd_ctx,
|
||||
hdd_ctx->p2p_device_address.bytes);
|
||||
hdd_err("Failed to open p2p interface");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
@@ -13154,8 +13157,10 @@ static QDF_STATUS hdd_open_ocb_interface(struct hdd_context *hdd_ctx)
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_OCB_MODE);
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_OCB_MODE,
|
||||
"wlanocb%d", mac_addr);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
hdd_err("Failed to open 802.11p interface");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -13173,8 +13178,10 @@ static QDF_STATUS hdd_open_concurrent_interface(struct hdd_context *hdd_ctx)
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_STA_MODE);
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_STA_MODE,
|
||||
iface_name, mac_addr);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
hdd_err("Failed to open concurrent station interface");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -13195,8 +13202,10 @@ hdd_open_adapters_for_mission_mode(struct hdd_context *hdd_ctx)
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_STA_MODE);
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_STA_MODE,
|
||||
"wlan%d", mac_addr);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* opening concurrent STA is best effort, continue on error */
|
||||
hdd_open_concurrent_interface(hdd_ctx);
|
||||
@@ -13214,8 +13223,10 @@ hdd_open_adapters_for_mission_mode(struct hdd_context *hdd_ctx)
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_NAN_DISC_MODE);
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_NAN_DISC_MODE,
|
||||
"wifi-aware%d", mac_addr);
|
||||
if (status)
|
||||
if (status) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
goto err_close_adapters;
|
||||
}
|
||||
}
|
||||
/* Open 802.11p Interface */
|
||||
if (dot11p_mode == CFG_11P_CONCURRENT) {
|
||||
@@ -13234,19 +13245,38 @@ err_close_adapters:
|
||||
|
||||
static QDF_STATUS hdd_open_adapters_for_ftm_mode(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
uint8_t *mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_FTM_MODE);
|
||||
QDF_STATUS status;
|
||||
uint8_t *mac_addr;
|
||||
|
||||
return hdd_open_adapter_no_trans(hdd_ctx, QDF_FTM_MODE,
|
||||
"wlan%d", mac_addr);
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_FTM_MODE);
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_FTM_MODE,
|
||||
"wlan%d", mac_addr);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
return status;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
hdd_open_adapters_for_monitor_mode(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
uint8_t *mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_MONITOR_MODE);
|
||||
QDF_STATUS status;
|
||||
uint8_t *mac_addr;
|
||||
|
||||
return hdd_open_adapter_no_trans(hdd_ctx, QDF_MONITOR_MODE,
|
||||
"wlan%d", mac_addr);
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_MONITOR_MODE);
|
||||
|
||||
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_MONITOR_MODE,
|
||||
"wlan%d", mac_addr);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, mac_addr);
|
||||
return status;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS hdd_open_adapters_for_epping_mode(struct hdd_context *hdd_ctx)
|
||||
|
@@ -582,6 +582,8 @@ int hdd_ndi_open(char *iface_name)
|
||||
adapter = hdd_open_adapter(hdd_ctx, QDF_NDI_MODE, iface_name,
|
||||
ndi_mac_addr, NET_NAME_UNKNOWN, true);
|
||||
if (!adapter) {
|
||||
if (!cfg_nan_get_ndi_mac_randomize(hdd_ctx->psoc))
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, ndi_mac_addr);
|
||||
hdd_err("hdd_open_adapter failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur