diff options
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_ieee80211.c')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_ieee80211.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c index c8998cb276be..62354c3194bd 100644 --- a/drivers/staging/r8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c @@ -653,11 +653,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, /* first 3 bytes in vendor specific information element are the IEEE * OUI of the vendor. The following byte is used a vendor specific * sub-type. */ - if (elen < 4) { - if (show_errors) { - } + if (elen < 4) return -1; - } oui = RTW_GET_BE24(pos); switch (oui) { @@ -672,9 +669,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, elems->wpa_ie_len = elen; break; case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */ - if (elen < 5) { + if (elen < 5) return -1; - } switch (pos[4]) { case WME_OUI_SUBTYPE_INFORMATION_ELEMENT: case WME_OUI_SUBTYPE_PARAMETER_ELEMENT: @@ -740,11 +736,8 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, elen = *pos++; left -= 2; - if (elen > left) { - if (show_errors) { - } + if (elen > left) return ParseFailed; - } switch (id) { case WLAN_EID_SSID: @@ -825,8 +818,6 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, break; default: unknown++; - if (!show_errors) - break; break; } left -= elen; @@ -874,9 +865,8 @@ void rtw_macaddr_cfg(u8 *mac_addr) ether_addr_copy(mac, mac_addr); } - if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) { + if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) eth_random_addr(mac_addr); - } } /** |