re: net: ll_temac: Cleanup multicast filter on change

From: Colin Ian King
Date: Fri May 24 2019 - 18:44:30 EST


Hi,

static analysis with Coverity has detected a potential issue with the
following commit:

commit 1b3fa5cf859bce7094ac18d32f54af8a7148ad51
Author: Esben Haabendal <esben@xxxxxxxxxx>
Date: Thu May 23 14:02:21 2019 +0200

net: ll_temac: Cleanup multicast filter on change

In function temac_set_multicast_list
(drivers/net/ethernet/xilinx/ll_temac_main.c), loop counter i is *only*
initialized in the code block:

if (!netdev_mc_empty(ndev)) {
...
}

Following this if code block there is a while-loop that iterates using i
as counter which will be problematic if i has not been correctly
initialized:

while (i < MULTICAST_CAM_TABLE_NUM) {
temac_indirect_out32_locked(lp, XTE_MAW0_OFFSET, 0);
temac_indirect_out32_locked(lp, XTE_MAW1_OFFSET, i << 16);
i++;
}

Colin