mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-19 05:24:11 +00:00
rtlwifi: rtl8192cu: Fix more pointer arithmetic errors
This driver uses a number of macros to get and set various fields in the RX and TX descriptors. To work correctly, a u8 pointer to the descriptor must be used; however, in some cases a descriptor structure pointer is used instead. In addition, a duplicated statement is removed. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
353d2a69ea
commit
eafbdde9c5
2 changed files with 6 additions and 6 deletions
|
@ -769,7 +769,7 @@ static long _rtl92c_signal_scale_mapping(struct ieee80211_hw *hw,
|
||||||
|
|
||||||
static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
|
static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
|
||||||
struct rtl_stats *pstats,
|
struct rtl_stats *pstats,
|
||||||
struct rx_desc_92c *pdesc,
|
struct rx_desc_92c *p_desc,
|
||||||
struct rx_fwinfo_92c *p_drvinfo,
|
struct rx_fwinfo_92c *p_drvinfo,
|
||||||
bool packet_match_bssid,
|
bool packet_match_bssid,
|
||||||
bool packet_toself,
|
bool packet_toself,
|
||||||
|
@ -784,11 +784,11 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
|
||||||
u32 rssi, total_rssi = 0;
|
u32 rssi, total_rssi = 0;
|
||||||
bool in_powersavemode = false;
|
bool in_powersavemode = false;
|
||||||
bool is_cck_rate;
|
bool is_cck_rate;
|
||||||
|
u8 *pdesc = (u8 *)p_desc;
|
||||||
|
|
||||||
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
|
is_cck_rate = RX_HAL_IS_CCK_RATE(p_desc);
|
||||||
pstats->packet_matchbssid = packet_match_bssid;
|
pstats->packet_matchbssid = packet_match_bssid;
|
||||||
pstats->packet_toself = packet_toself;
|
pstats->packet_toself = packet_toself;
|
||||||
pstats->is_cck = is_cck_rate;
|
|
||||||
pstats->packet_beacon = packet_beacon;
|
pstats->packet_beacon = packet_beacon;
|
||||||
pstats->is_cck = is_cck_rate;
|
pstats->is_cck = is_cck_rate;
|
||||||
pstats->RX_SIGQ[0] = -1;
|
pstats->RX_SIGQ[0] = -1;
|
||||||
|
|
|
@ -303,10 +303,10 @@ out:
|
||||||
bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
|
bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
|
||||||
struct rtl_stats *stats,
|
struct rtl_stats *stats,
|
||||||
struct ieee80211_rx_status *rx_status,
|
struct ieee80211_rx_status *rx_status,
|
||||||
u8 *p_desc, struct sk_buff *skb)
|
u8 *pdesc, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct rx_fwinfo_92c *p_drvinfo;
|
struct rx_fwinfo_92c *p_drvinfo;
|
||||||
struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc;
|
struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc;
|
||||||
u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc);
|
u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc);
|
||||||
|
|
||||||
stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc);
|
stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc);
|
||||||
|
@ -345,7 +345,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
|
||||||
if (phystatus) {
|
if (phystatus) {
|
||||||
p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
|
p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
|
||||||
stats->rx_bufshift);
|
stats->rx_bufshift);
|
||||||
rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc,
|
rtl92c_translate_rx_signal_stuff(hw, skb, stats, p_desc,
|
||||||
p_drvinfo);
|
p_drvinfo);
|
||||||
}
|
}
|
||||||
/*rx_status->qual = stats->signal; */
|
/*rx_status->qual = stats->signal; */
|
||||||
|
|
Loading…
Add table
Reference in a new issue