On Thu, 2024-06-20 at 13:11 +0200, Felix Fietkau wrote: > > +static inline u32 > +rdev_get_radio_mask(struct cfg80211_registered_device *rdev, > + struct net_device *dev) > +{ > + struct wiphy *wiphy = &rdev->wiphy; > + u32 ret; > + > + if (!rdev->ops->get_radio_mask) > + return 0; > + > + trace_rdev_get_radio_mask(wiphy, dev); > + ret = rdev->ops->get_radio_mask(wiphy, dev); > + trace_rdev_return_int(wiphy, ret); I'd tend to prefer tracing even if it's not implemented, so we see what's going on? Though personally I guess in this case I don't even care much since mac80211 will unconditionally implement it ... > @@ -2366,14 +2374,19 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, > void *data), > void *data) > { > + const struct wiphy_radio *radio = NULL; > + const struct ieee80211_iface_combination *c, *cs; > const struct ieee80211_regdomain *regdom; > enum nl80211_dfs_regions region = 0; > - int i, j, iftype; > + int i, j, n, iftype; > int num_interfaces = 0; > u32 used_iftypes = 0; > u32 beacon_int_gcd; > bool beacon_int_different; > > + if (params->radio_idx >= 0) > + radio = &wiphy->radio[params->radio_idx]; Maybe we should have a sanity bounds check? Or even really just __counted_by() annotations in struct wiphy_radio, so we can run with UBSAN in testing (which would be a comment for patch 2, but I'm not going to send it there again ;-) ). johannes