qcacld-3.0: Fix anomalies with hdd_stop_bss_link()

Address the following anomalies with hdd_stop_bss_link():
- Parameter usrDataForCallback is unused
- It returns errno but one caller is checking for QDF_STATUS

Change-Id: I31086d790066eec5774cf318eff0f90736b4c92f
CRs-Fixed: 2213062
This commit is contained in:
Jeff Johnson
2018-03-24 17:36:59 -07:00
committed by nshrivas
parent d69ec37568
commit 0604a3650d
2 changed files with 17 additions and 23 deletions

View File

@@ -834,21 +834,18 @@ static void hdd_clear_all_sta(struct hdd_adapter *adapter)
hdd_clear_sta(adapter, sta_id); hdd_clear_sta(adapter, sta_id);
} }
static int hdd_stop_bss_link(struct hdd_adapter *adapter, static int hdd_stop_bss_link(struct hdd_adapter *adapter)
void *usrDataForCallback)
{ {
struct net_device *dev; struct hdd_context *hdd_ctx;
struct hdd_context *hdd_ctx = NULL; int errno;
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status;
dev = (struct net_device *)usrDataForCallback;
hdd_enter(); hdd_enter();
hdd_ctx = WLAN_HDD_GET_CTX(adapter); hdd_ctx = WLAN_HDD_GET_CTX(adapter);
status = wlan_hdd_validate_context(hdd_ctx); errno = wlan_hdd_validate_context(hdd_ctx);
if (errno)
if (0 != status) return errno;
return status;
if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) { if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
status = wlansap_stop_bss( status = wlansap_stop_bss(
@@ -862,9 +859,10 @@ static int hdd_stop_bss_link(struct hdd_adapter *adapter,
adapter->session_id); adapter->session_id);
hdd_start_green_ap_state_mc(hdd_ctx, adapter->device_mode, hdd_start_green_ap_state_mc(hdd_ctx, adapter->device_mode,
false); false);
errno = (status == QDF_STATUS_SUCCESS) ? 0 : -EBUSY;
} }
hdd_exit(); hdd_exit();
return (status == QDF_STATUS_SUCCESS) ? 0 : -EBUSY; return errno;
} }
/** /**
@@ -1625,7 +1623,7 @@ hdd_stop_sap_due_to_invalid_channel(struct work_struct *work)
} }
QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
void *usrDataForCallback) void *context)
{ {
struct hdd_adapter *adapter; struct hdd_adapter *adapter;
struct hdd_ap_ctx *ap_ctx; struct hdd_ap_ctx *ap_ctx;
@@ -1661,9 +1659,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
tSap_StationDisassocCompleteEvent *disassoc_comp; tSap_StationDisassocCompleteEvent *disassoc_comp;
struct hdd_station_info *stainfo; struct hdd_station_info *stainfo;
dev = (struct net_device *)usrDataForCallback; dev = context;
if (!dev) { if (!dev) {
hdd_err("usrDataForCallback is null"); hdd_err("context is null");
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -1767,8 +1765,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_warn("Failed to register BC STA %d", hdd_warn("Failed to register BC STA %d",
qdf_status); qdf_status);
hdd_stop_bss_link(adapter, hdd_stop_bss_link(adapter);
usrDataForCallback);
} }
} }
@@ -2495,12 +2492,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
case eSAP_MAC_TRIG_STOP_BSS_EVENT: case eSAP_MAC_TRIG_STOP_BSS_EVENT:
qdf_status = ret = hdd_stop_bss_link(adapter);
hdd_stop_bss_link(adapter, usrDataForCallback); if (ret)
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_warn("hdd_stop_bss_link failed %d", ret);
hdd_warn("hdd_stop_bss_link failed %d",
qdf_status);
}
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
case eSAP_CHANNEL_CHANGE_EVENT: case eSAP_CHANNEL_CHANGE_EVENT:

View File

@@ -128,7 +128,7 @@ int hdd_softap_unpack_ie(tHalHandle halHandle,
uint16_t gen_ie_len, uint8_t *gen_ie); uint16_t gen_ie_len, uint8_t *gen_ie);
QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
void *usrDataForCallback); void *context);
/** /**
* hdd_init_ap_mode() - to init the AP adaptor * hdd_init_ap_mode() - to init the AP adaptor
* @adapter: SAP/GO adapter * @adapter: SAP/GO adapter