net: wireless: bcm4329: fix array subscript is below array bounds
authorChoi, Jong-Hwan <jhbird.choi@samsung.com>
Fri, 15 Jul 2011 01:56:25 +0000 (10:56 +0900)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 22 Jul 2011 00:10:25 +0000 (17:10 -0700)
Change-Id: I5d521895070d255f7ac0c9eaf262ec9f4cdd2f8a
Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
drivers/net/wireless/bcm4329/dhd_linux.c

index c2d6587f30a5707d95a29dd8e0de2ff229d6ebc5..5c1384bdc2154cedb28989937253febb287e884b 100644 (file)
@@ -1941,6 +1941,9 @@ dhd_open(struct net_device *net)
        ifidx = dhd_net2idx(dhd, net);
        DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx));
 
+       if (ifidx == DHD_BAD_IF)
+               return -1;
+
        if ((dhd->iflist[ifidx]) && (dhd->iflist[ifidx]->state == WLC_E_IF_DEL)) {
                DHD_ERROR(("%s: Error: called when IF already deleted\n", __FUNCTION__));
                return -1;