Skip to content

Commit c34b10b

Browse files
Dan CarpenterNipaLocal
Dan Carpenter
authored and
NipaLocal
committed
net: mvpp2: Don't re-use loop iterator
This function has a nested loop. The problem is that both the inside and outside loop use the same variable as an iterator. I found this via static analysis so I'm not sure the impact. It could be that it loops forever or, more likely, the loop exits early. Fixes: 3a616b9 ("net: mvpp2: Add TX flow control support for jumbo frames") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: NipaLocal <nipa@local>
1 parent 301927d commit c34b10b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -953,13 +953,13 @@ static void mvpp2_bm_pool_update_fc(struct mvpp2_port *port,
953953
static void mvpp2_bm_pool_update_priv_fc(struct mvpp2 *priv, bool en)
954954
{
955955
struct mvpp2_port *port;
956-
int i;
956+
int i, j;
957957

958958
for (i = 0; i < priv->port_count; i++) {
959959
port = priv->port_list[i];
960960
if (port->priv->percpu_pools) {
961-
for (i = 0; i < port->nrxqs; i++)
962-
mvpp2_bm_pool_update_fc(port, &port->priv->bm_pools[i],
961+
for (j = 0; j < port->nrxqs; j++)
962+
mvpp2_bm_pool_update_fc(port, &port->priv->bm_pools[j],
963963
port->tx_fc & en);
964964
} else {
965965
mvpp2_bm_pool_update_fc(port, port->pool_long, port->tx_fc & en);

0 commit comments

Comments
 (0)