]> err.no Git - linux-2.6/commitdiff
[PATCH] zd1211rw: Fixed array size issue in reset_mode
authorUlrich Kunitz <kune@deine-taler.de>
Mon, 29 Jan 2007 00:59:40 +0000 (00:59 +0000)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Feb 2007 20:23:54 +0000 (15:23 -0500)
Andy Green found this issue.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_mac.c

index a08524191b5d837d0f24c92e8a37374f5a2e5d24..1379c91a84a25369feffba89082bfa9611f1d85c 100644 (file)
@@ -156,7 +156,7 @@ void zd_mac_clear(struct zd_mac *mac)
 static int reset_mode(struct zd_mac *mac)
 {
        struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
-       struct zd_ioreq32 ioreqs[3] = {
+       struct zd_ioreq32 ioreqs[] = {
                { CR_RX_FILTER, STA_RX_FILTER },
                { CR_SNIFFER_ON, 0U },
        };
@@ -164,10 +164,9 @@ static int reset_mode(struct zd_mac *mac)
        if (ieee->iw_mode == IW_MODE_MONITOR) {
                ioreqs[0].value = 0xffffffff;
                ioreqs[1].value = 0x1;
-               ioreqs[2].value = ENC_SNIFFER;
        }
 
-       return zd_iowrite32a(&mac->chip, ioreqs, 3);
+       return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs));
 }
 
 int zd_mac_open(struct net_device *netdev)