]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] rt2x00: Allways memset memory obtained from skb_push()
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 6 Oct 2007 12:18:22 +0000 (14:18 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:17 +0000 (16:55 -0700)
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>
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 45f8f744a12dabf201922be8dfb2d586334a3071..7cdc80a122bb9aaa10b9f9eb514fad6c1d0005de 100644 (file)
@@ -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),
index 1a869a5cbe911eef2d561e6bb61157fcc8197318..01dbef19d651f14f902805f451afa20246fc01a4 100644 (file)
@@ -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),
index 67a1e3750d4d1725c14bc864103b5d133de51e87..3e42759473c3d1e0041f975ae54656fe8b33f88d 100644 (file)
@@ -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),