diff options
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 0f97b5af91e4..6278734c735f 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -1341,7 +1341,7 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1341 | * within that register. | 1341 | * within that register. |
1342 | */ | 1342 | */ |
1343 | else if (!netdev_mc_empty(dev)) { | 1343 | else if (!netdev_mc_empty(dev)) { |
1344 | struct dev_mc_list *cur_addr; | 1344 | struct netdev_hw_addr *ha; |
1345 | 1345 | ||
1346 | /* Set the Hash perfec mode */ | 1346 | /* Set the Hash perfec mode */ |
1347 | mcr |= MAC_CR_HPFILT_; | 1347 | mcr |= MAC_CR_HPFILT_; |
@@ -1349,19 +1349,16 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1349 | /* start with a table of all zeros: reject all */ | 1349 | /* start with a table of all zeros: reject all */ |
1350 | memset(multicast_table, 0, sizeof(multicast_table)); | 1350 | memset(multicast_table, 0, sizeof(multicast_table)); |
1351 | 1351 | ||
1352 | netdev_for_each_mc_addr(cur_addr, dev) { | 1352 | netdev_for_each_mc_addr(ha, dev) { |
1353 | u32 position; | 1353 | u32 position; |
1354 | 1354 | ||
1355 | /* do we have a pointer here? */ | ||
1356 | if (!cur_addr) | ||
1357 | break; | ||
1358 | /* make sure this is a multicast address - | 1355 | /* make sure this is a multicast address - |
1359 | shouldn't this be a given if we have it here ? */ | 1356 | shouldn't this be a given if we have it here ? */ |
1360 | if (!(*cur_addr->dmi_addr & 1)) | 1357 | if (!(*ha->addr & 1)) |
1361 | continue; | 1358 | continue; |
1362 | 1359 | ||
1363 | /* upper 6 bits are used as hash index */ | 1360 | /* upper 6 bits are used as hash index */ |
1364 | position = ether_crc(ETH_ALEN, cur_addr->dmi_addr)>>26; | 1361 | position = ether_crc(ETH_ALEN, ha->addr)>>26; |
1365 | 1362 | ||
1366 | multicast_table[position>>5] |= 1 << (position&0x1f); | 1363 | multicast_table[position>>5] |= 1 << (position&0x1f); |
1367 | } | 1364 | } |