]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Avoid a false maybe-uninitialized compiler warning
authorJouni Malinen <j@w1.fi>
Sun, 30 Nov 2014 13:37:55 +0000 (15:37 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 30 Nov 2014 13:53:11 +0000 (15:53 +0200)
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 <j@w1.fi>
wpa_supplicant/mesh_mpm.c

index e5b569e881e0f449be5ca6fb95de5b33ba30a121..2e5afd96c115a5e33ee1e0aca29dd06bc9309f54 100644 (file)
@@ -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);
 }