mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-24 17:36:15 +00:00
fix(esp_wifi): Add review comments and some cleanup
This commit is contained in:
@@ -845,16 +845,16 @@ int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
|
||||
const u8 *data, size_t data_len,
|
||||
int no_cck)
|
||||
{
|
||||
int ret = 0;
|
||||
wifi_mgmt_frm_req_t *req = os_zalloc(sizeof(*req) + data_len);;
|
||||
if (!req) {
|
||||
return -1;
|
||||
}
|
||||
int ret = -1;
|
||||
wifi_mgmt_frm_req_t *req;
|
||||
|
||||
if (!wpa_s->current_bss) {
|
||||
wpa_printf(MSG_ERROR, "STA not associated, return");
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
return ret;
|
||||
}
|
||||
|
||||
req = os_zalloc(sizeof(*req) + data_len);
|
||||
if (!req) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
req->ifx = WIFI_IF_STA;
|
||||
@@ -862,14 +862,14 @@ int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
|
||||
req->data_len = data_len;
|
||||
os_memcpy(req->data, data, req->data_len);
|
||||
|
||||
if (esp_wifi_send_mgmt_frm_internal(req) != 0) {
|
||||
wpa_printf(MSG_ERROR, "action frame sending failed");
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
wpa_printf(MSG_INFO, "action frame sent");
|
||||
ret = esp_wifi_send_mgmt_frm_internal(req);
|
||||
|
||||
if (ret != 0) {
|
||||
wpa_printf(MSG_ERROR, "action frame sending failed");
|
||||
} else {
|
||||
wpa_printf(MSG_INFO, "action frame sent");
|
||||
}
|
||||
|
||||
cleanup:
|
||||
os_free(req);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user