mac80211_hwsim: ask mac80211 to reserve space for chanctx.drv_priv
authorKarl Beldan <karl.beldan@rivierawaves.com>
Thu, 14 Feb 2013 23:03:14 +0000 (00:03 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Feb 2013 08:41:45 +0000 (09:41 +0100)
Otherwise memory corruption occurs when using channel contexts (ATM when
param 'channel' > 1).

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index b73e497fe77049b59d13f9c822492c2dceb2aba1..cffdf4fbf161e63e615e0fc33564eb973248bc33 100644 (file)
@@ -2247,6 +2247,7 @@ static int __init init_mac80211_hwsim(void)
                /* ask mac80211 to reserve space for magic */
                hw->vif_data_size = sizeof(struct hwsim_vif_priv);
                hw->sta_data_size = sizeof(struct hwsim_sta_priv);
+               hw->chanctx_data_size = sizeof(struct hwsim_chanctx_priv);
 
                memcpy(data->channels_2ghz, hwsim_channels_2ghz,
                        sizeof(hwsim_channels_2ghz));