提交 436b37c5 编写于 作者: C Christian Lamparter 提交者: John W. Linville

p54: fix a fw crash caused by statistic feedback

This patch fixes a bug which crawled into the tree with the split-up
changes.

The memory-manager wasn't aware of the statistic feedback
extra_len space requirements and happily placed following frames
into the allegedly free spots.

Thanks fly out to Larry Finger for taking the time to
test all (permutations of) patches and theories all day long.
Acked-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NChristian Lamparter <chunkeey@web.de>
Tested-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 46df10ae
......@@ -686,6 +686,8 @@ int p54_upload_key(struct p54_common *priv, u8 algo, int slot, u8 idx, u8 len,
int p54_fetch_statistics(struct p54_common *priv)
{
struct ieee80211_tx_info *txinfo;
struct p54_tx_info *p54info;
struct sk_buff *skb;
skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL,
......@@ -694,6 +696,20 @@ int p54_fetch_statistics(struct p54_common *priv)
if (!skb)
return -ENOMEM;
/*
* The statistic feedback causes some extra headaches here, if it
* is not to crash/corrupt the firmware data structures.
*
* Unlike all other Control Get OIDs we can not use helpers like
* skb_put to reserve the space for the data we're requesting.
* Instead the extra frame length -which will hold the results later-
* will only be told to the p54_assign_address, so that following
* frames won't be placed into the allegedly empty area.
*/
txinfo = IEEE80211_SKB_CB(skb);
p54info = (void *) txinfo->rate_driver_data;
p54info->extra_len = sizeof(struct p54_statistics);
p54_tx(priv, skb);
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册