summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2013-10-08 10:18:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-13 12:05:31 +0900
commit3af669ca9923d504d5476bcfe04eaf4bbde03515 (patch)
tree43ffb4e20f4f041c542f86f9834cf4958c936232
parent6f2c0ed7835fd30d6c137198cf1dc964f061f132 (diff)
downloadlinux-3.10-3af669ca9923d504d5476bcfe04eaf4bbde03515.tar.gz
linux-3.10-3af669ca9923d504d5476bcfe04eaf4bbde03515.tar.bz2
linux-3.10-3af669ca9923d504d5476bcfe04eaf4bbde03515.zip
rtlwifi: rtl8192cu: Fix error in pointer arithmetic
commit 9473ca6e920a3b9ca902753ce52833657f9221cc upstream. An error in calculating the offset in an skb causes the driver to read essential device info from the wrong locations. The main effect is that automatic gain calculations are nonsense. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 763cf1defab..5a060e537fb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
(bool)GET_RX_DESC_PAGGR(pdesc));
rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
if (phystatus) {
- p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE);
+ p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
+ stats->rx_bufshift);
rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc,
p_drvinfo);
}