Skip to content

Commit

Permalink
[PATCH] rt2x00: Allways memset memory obtained from skb_push()
Browse files Browse the repository at this point in the history
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: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Ivo van Doorn authored and David S. Miller committed Oct 10, 2007
1 parent 3789447 commit c22eb87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,8 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
* First we create the beacon.
*/
skb_push(skb, ring->desc_size);
memset(skb->data, 0, ring->desc_size);

rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data +
ring->desc_size),
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/rt2x00/rt61pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,6 +2437,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
* First we create the beacon.
*/
skb_push(skb, TXD_DESC_SIZE);
memset(skb->data, 0, TXD_DESC_SIZE);

rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data +
TXD_DESC_SIZE),
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,8 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
* First we create the beacon.
*/
skb_push(skb, TXD_DESC_SIZE);
memset(skb->data, 0, TXD_DESC_SIZE);

rt2x00lib_write_tx_desc(rt2x00dev, (struct data_desc *)skb->data,
(struct ieee80211_hdr *)(skb->data +
TXD_DESC_SIZE),
Expand Down

0 comments on commit c22eb87

Please sign in to comment.