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>
This commit is contained in:
parent
9e46b31273
commit
857c4dfa83
1 changed files with 3 additions and 0 deletions
|
@ -8232,6 +8232,9 @@ struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
|
|
||||||
|
if (!modes)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (i = 0; i < num_modes; i++) {
|
for (i = 0; i < num_modes; i++) {
|
||||||
if (modes[i].mode != mode ||
|
if (modes[i].mode != mode ||
|
||||||
!modes[i].num_channels || !modes[i].channels)
|
!modes[i].num_channels || !modes[i].channels)
|
||||||
|
|
Loading…
Reference in a new issue