]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove a pointer check that can never be true
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 7 Jan 2016 14:47:17 +0000 (16:47 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 7 Jan 2016 14:47:17 +0000 (16:47 +0200)
chan is set to the result of pointer arithmetic (pointer to an entry in
an array) that can never be NULL. As such, there is no need to check for
it to be non-NULL before deference. Remove this check to avoid
complaints from static analyzers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/drv_callbacks.c

index aad0d81af8975242af1566ffffede4edf96a6c8d..9f53660a001718f17e8d170480f629b522f35d80 100644 (file)
@@ -956,8 +956,6 @@ static struct hostapd_channel_data * hostapd_get_mode_channel(
 
        for (i = 0; i < iface->current_mode->num_channels; i++) {
                chan = &iface->current_mode->channels[i];
-               if (!chan)
-                       return NULL;
                if ((unsigned int) chan->freq == freq)
                        return chan;
        }