bnx2x: fix vector traveling while looking for an empty entry
authorDmitry Kravkov <dmitry@broadcom.com>
Mon, 26 Mar 2012 21:08:55 +0000 (21:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Mar 2012 02:41:34 +0000 (22:41 -0400)
Fixes the bug that may prevent from mac to be configured,
while there is an empty slot for it.

Reported-by: Maciej Żenczykowski <zenczykowski@gmail.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c

index 3f52fadee3edb15c1628099b06fd8786940219ef..5135733216252e2e05767515d1f0893c9715047d 100644 (file)
@@ -3847,7 +3847,7 @@ static bool bnx2x_credit_pool_get_entry(
                        continue;
 
                /* If we've got here we are going to find a free entry */
-               for (idx = vec * BNX2X_POOL_VEC_SIZE, i = 0;
+               for (idx = vec * BIT_VEC64_ELEM_SZ, i = 0;
                      i < BIT_VEC64_ELEM_SZ; idx++, i++)
 
                        if (BIT_VEC64_TEST_BIT(o->pool_mirror, idx)) {