net:wifi: fixed -O2 compile error"array subscript is below array bounds"
authorlbt <lbt@rock-chip.com>
Tue, 5 Jul 2011 06:48:55 +0000 (14:48 +0800)
committerlbt <lbt@rock-chip.com>
Tue, 5 Jul 2011 06:48:55 +0000 (14:48 +0800)
drivers/net/wireless/bcm4329/dhd_linux.c

index 825caea60b95319feb98426113b28ac8129a380e..622e2a9eb0b26047fa0f5d4842251d1509264e8f 100644 (file)
@@ -1903,6 +1903,8 @@ dhd_open(struct net_device *net)
        wl_control_wl_start(net);
 
        ifidx = dhd_net2idx(dhd, net);
+        if (ifidx == DHD_BAD_IF)
+                return -1;
        DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx));
 
        if ((dhd->iflist[ifidx]) && (dhd->iflist[ifidx]->state == WLC_E_IF_DEL)) {