Search Linux Wireless

Re: [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2023-03-06 at 18:50 +0100, Lorenzo Bianconi wrote:
> 
> +struct ieee80211_ops *
> +mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features)
> +{
> +	struct ieee80211_ops *ops;
> +
> +	ops = devm_kmemdup(dev, &mt7921_ops, sizeof(mt7921_ops), GFP_KERNEL);

It's kind of nice to have static const ops so they can't be a target for
overwriting and function pointer injection, maybe just declare two
copies with a macro or so, with and without chanctx, and return the
appropriate one? It won't even use more memory unless you never run a
device w/o chanctx ops.

johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux