Skip to content

Commit 13d0a9b

Browse files
Harshvardhan Jhagregkh
authored andcommitted
net: qede: Fix end of loop tests for list_for_each_entry
[ Upstream commit 795e3d2 ] The list_for_each_entry() iterator, "vlan" in this code, can never be NULL so the warning will never be printed. Signed-off-by: Harshvardhan Jha <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1478e90 commit 13d0a9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/qlogic/qede/qede_filter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ int qede_configure_vlan_filters(struct qede_dev *edev)
831831
int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
832832
{
833833
struct qede_dev *edev = netdev_priv(dev);
834-
struct qede_vlan *vlan = NULL;
834+
struct qede_vlan *vlan;
835835
int rc = 0;
836836

837837
DP_VERBOSE(edev, NETIF_MSG_IFDOWN, "Removing vlan 0x%04x\n", vid);
@@ -842,7 +842,7 @@ int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
842842
if (vlan->vid == vid)
843843
break;
844844

845-
if (!vlan || (vlan->vid != vid)) {
845+
if (list_entry_is_head(vlan, &edev->vlan_list, list)) {
846846
DP_VERBOSE(edev, (NETIF_MSG_IFUP | NETIF_MSG_IFDOWN),
847847
"Vlan isn't configured\n");
848848
goto out;

0 commit comments

Comments
 (0)