diff mbox

mac80211_hwsim: ask mac80211 to reserve space for chanctx.drv_priv

Message ID 1360882994-13250-1-git-send-email-karl@eleaks.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Karl Beldan Feb. 14, 2013, 11:03 p.m. UTC
From: Karl Beldan <karl.beldan@rivierawaves.com>

Otherwise memory corruption occurs when using channel contexts (ATM when
param 'channel' > 1).

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
---
 drivers/net/wireless/mac80211_hwsim.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Berg Feb. 14, 2013, 11:55 p.m. UTC | #1
On Fri, 2013-02-15 at 00:03 +0100, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
> 
> Otherwise memory corruption occurs when using channel contexts (ATM when
> param 'channel' > 1).

Heh, and I've been using it forever with that in kvm, I guess it depends
on the allocator (and the resulting ksize() of the object).

Applied, thanks!

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b73e497..cffdf4f 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -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));