Commit c22eb87b authored by Ivo van Doorn's avatar Ivo van Doorn Committed by David S. Miller

[PATCH] rt2x00: Allways memset memory obtained from skb_push()

When skb_push() is used we should memset the memory before
usage. This will prevent bugs which could occur when the
data is treated as TX descriptor.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 37894473
...@@ -1665,6 +1665,8 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw, ...@@ -1665,6 +1665,8 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
* First we create the beacon. * First we create the beacon.
*/ */
skb_push(skb, ring->desc_size); skb_push(skb, ring->desc_size);
memset(skb->data, 0, ring->desc_size);
rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data, rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data + (struct ieee80211_hdr *)(skb->data +
ring->desc_size), ring->desc_size),
......
...@@ -2437,6 +2437,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -2437,6 +2437,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
* First we create the beacon. * First we create the beacon.
*/ */
skb_push(skb, TXD_DESC_SIZE); skb_push(skb, TXD_DESC_SIZE);
memset(skb->data, 0, TXD_DESC_SIZE);
rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data, rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data + (struct ieee80211_hdr *)(skb->data +
TXD_DESC_SIZE), TXD_DESC_SIZE),
......
...@@ -1939,6 +1939,8 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1939,6 +1939,8 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
* First we create the beacon. * First we create the beacon.
*/ */
skb_push(skb, TXD_DESC_SIZE); skb_push(skb, TXD_DESC_SIZE);
memset(skb->data, 0, TXD_DESC_SIZE);
rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data, rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data + (struct ieee80211_hdr *)(skb->data +
TXD_DESC_SIZE), TXD_DESC_SIZE),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment