]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
atheros: Avoid clang compiler warning on address of array check
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 16:02:16 +0000 (18:02 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:48:49 +0000 (19:48 +0200)
ie.wps_ie is an array, so there is no point in checking whether it is
NULL.

driver_atheros.c:1221:9: error: address of array 'ie.wps_ie' will
      always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

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

index 62f5baad63612ee7ff07f439e032ea2e43b8423a..807cd94691d0d8f39571564df85ebf1143fd5d5e 100644 (file)
@@ -1218,8 +1218,7 @@ atheros_new_sta(struct atheros_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
 
 #ifdef ATH_WPS_IE
        /* if WPS IE is present, preference is given to WPS */
-       if (ie.wps_ie &&
-           (ie.wps_ie[1] > 0 && (ie.wps_ie[0] == WLAN_EID_VENDOR_SPECIFIC))) {
+       if (ie.wps_ie[0] == WLAN_EID_VENDOR_SPECIFIC && ie.wps_ie[1] > 0) {
                iebuf = ie.wps_ie;
                ielen = ie.wps_ie[1];
        }