On 5/22/2025 4:53 PM, Johannes Berg wrote: >>>> + for (i = 0; i < scan_req->n_channels; i++) { >>>> + chan = scan_req->channels[i]; >>>> + chan_radio_idx = cfg80211_get_radio_idx_by_chan(wiphy, chan); >>>> + /* >>>> + * Skip channels with an invalid radio index and continue >>>> + * checking. If any channel in the scan request matches the >>>> + * given radio index, return true. >>>> + */ >>>> + if (chan_radio_idx < 0) >>>> + continue; >>> This seems ... wrong? If there's a channel in the scan request that >>> didn't map to _any_ radio then how are we even scanning there? And the >>> comment seems even stranger, why would we _want_ to ignore it (which it >>> conveniently doesn't answer)? >>> >> It seems, (chan_radio_idx < 0) should never be true because the chan is >> taken from the valid scan request. I should remove this check in next version? > I'm not sure, why did you add it? Maybe it should be a WARN_ON and abort > the whole function? It just doesn't seem right to _ignore_. I initially added the check as a precautionary measure. In the next version, I’ll replace it with a WARN_ON() to flag the unexpected condition. As a conservative approach, will return true in that case, assuming the scan request might use the specified radio_idx to safely abort the function.