3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-20 19:12:33 +01:00

util: warn on invalid channels when iterating a frequency set

This should not happen but if it does we should alert the user.
This commit is contained in:
James Prestwood 2024-10-24 09:46:35 -07:00 committed by Denis Kenzior
parent d0b9fc84b5
commit 65073ffcfa

View File

@ -464,6 +464,11 @@ static void scan_channels_foreach(uint32_t channel, void *user_data)
uint32_t freq; uint32_t freq;
freq = band_channel_to_freq(channel, channels_data->band); freq = band_channel_to_freq(channel, channels_data->band);
if (!freq) {
l_warn("invalid channel %u for band %u", channel,
channels_data->band);
return;
}
channels_data->func(freq, channels_data->user_data); channels_data->func(freq, channels_data->user_data);
} }