Make get_mode() easier for static analyzers

Add an explicit check for modes != NULL instead of depending on
num_modes > 0 implying that. This is to silence invalid static analyzer
reports.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
master
Jouni Malinen 3 years ago committed by Jouni Malinen
parent 9e46b31273
commit 857c4dfa83

@ -8232,6 +8232,9 @@ struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
{
u16 i;
if (!modes)
return NULL;
for (i = 0; i < num_modes; i++) {
if (modes[i].mode != mode ||
!modes[i].num_channels || !modes[i].channels)

Loading…
Cancel
Save