aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-02-18 16:46:40 (GMT)
committerJouni Malinen <j@w1.fi>2019-02-18 16:46:40 (GMT)
commit0f9632ceb8fb0d88749d62f7584bb6df81d1cbbb (patch)
tree80667b3d58316833986d2db932c7b191f1c1e9c4
parent61929f4b0793bda2ea4f4f78118d4b6189b190d0 (diff)
downloadhostap-0f9632ceb8fb0d88749d62f7584bb6df81d1cbbb.zip
hostap-0f9632ceb8fb0d88749d62f7584bb6df81d1cbbb.tar.gz
hostap-0f9632ceb8fb0d88749d62f7584bb6df81d1cbbb.tar.bz2
mesh: More consistent checking of wpa_s->ifmsh in completion handler
It does not look like wpa_s->ifmsg could be NULL here, but better be more consistent anyway to keep static analyzers happier by avoiding dereference of wpa_s->ifmsh in the function before the NULL check for it. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--wpa_supplicant/mesh.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index e9457f0..9260021 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -197,7 +197,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
struct wpa_ssid *ssid = wpa_s->current_ssid;
int ret;
- if (!params || !ssid) {
+ if (!params || !ssid || !ifmsh) {
wpa_printf(MSG_ERROR, "mesh: %s called without active mesh",
__func__);
return -1;
@@ -217,13 +217,11 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
wpa_s->mgmt_group_cipher = wpa_s->mesh_rsn->mgmt_group_cipher;
}
- if (ifmsh) {
- params->ies = ifmsh->mconf->rsn_ie;
- params->ie_len = ifmsh->mconf->rsn_ie_len;
- params->basic_rates = ifmsh->basic_rates;
- params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE;
- params->conf.ht_opmode = ifmsh->bss[0]->iface->ht_op_mode;
- }
+ params->ies = ifmsh->mconf->rsn_ie;
+ params->ie_len = ifmsh->mconf->rsn_ie_len;
+ params->basic_rates = ifmsh->basic_rates;
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE;
+ params->conf.ht_opmode = ifmsh->bss[0]->iface->ht_op_mode;
wpa_msg(wpa_s, MSG_INFO, "joining mesh %s",
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));