EAP peer: Simplify buildNotify return
authorJouni Malinen <j@w1.fi>
Sun, 7 Feb 2016 19:01:41 +0000 (21:01 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Feb 2016 19:01:41 +0000 (21:01 +0200)
There is no need for the local variable and two return statements.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_peer/eap.c

index 4634169..9110ca5 100644 (file)
@@ -1520,15 +1520,9 @@ static void eap_sm_processNotify(struct eap_sm *sm, const struct wpabuf *req)
 
 static struct wpabuf * eap_sm_buildNotify(int id)
 {
-       struct wpabuf *resp;
-
        wpa_printf(MSG_DEBUG, "EAP: Generating EAP-Response Notification");
-       resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_NOTIFICATION, 0,
-                            EAP_CODE_RESPONSE, id);
-       if (resp == NULL)
-               return NULL;
-
-       return resp;
+       return eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_NOTIFICATION, 0,
+                       EAP_CODE_RESPONSE, id);
 }