From 763041b2e8a1e06651b40f1c33f128e273b7ad6c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 30 Nov 2014 15:37:55 +0200 Subject: [PATCH] mesh: Avoid a false maybe-uninitialized compiler warning An earlier check of the action_field value above the switch statement already took care of all other possible cases, but that was apparently too difficult for the compiler to notice. Bring back the default case to avoid incorrect warnings about the event variable being maybe uninitialized. Signed-off-by: Jouni Malinen --- wpa_supplicant/mesh_mpm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index e5b569e88..2e5afd96c 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -971,6 +971,13 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s, else event = CLS_ACPT; break; + default: + /* + * This cannot be hit due to the action_field check above, but + * compilers may not be able to figure that out and can warn + * about uninitialized event below. + */ + return; } mesh_mpm_fsm(wpa_s, sta, event); }