From efd5d26d33da358d4a68667186a1dfbc65f5f87e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 20 Jun 2015 22:50:45 +0300 Subject: [PATCH] Remove unnecessary wpa_ie_len check from wpa_parse_wpa_ie_wpa() There is no need to have a separate "fail silently" case for wpa_ie_len == 0. That condition does not seem to be reachable and even if it were, the following "ie len too short" case will result in the exact same return value. Signed-off-by: Jouni Malinen --- src/common/wpa_common.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c index 2bac377ca..e485b5bf2 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c @@ -727,11 +727,6 @@ int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, data->num_pmkid = 0; data->mgmt_group_cipher = 0; - if (wpa_ie_len == 0) { - /* No WPA IE - fail silently */ - return -1; - } - if (wpa_ie_len < sizeof(struct wpa_ie_hdr)) { wpa_printf(MSG_DEBUG, "%s: ie len too short %lu", __func__, (unsigned long) wpa_ie_len);