Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c20afae7 authored by Karicheri, Muralidharan's avatar Karicheri, Muralidharan Committed by David S. Miller
Browse files

net: netcp: ethss: fix up incorrect use of list api



The code seems to assume a null is returned when the list is empty
from first_sec_slave() to break the loop which is incorrect. Fix the
code by using list_empty().

Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01a03099
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -2508,10 +2508,9 @@ static void free_secondary_ports(struct gbe_priv *gbe_dev)
{
{
	struct gbe_slave *slave;
	struct gbe_slave *slave;


	for (;;) {
	while (!list_empty(&gbe_dev->secondary_slaves)) {
		slave = first_sec_slave(gbe_dev);
		slave = first_sec_slave(gbe_dev);
		if (!slave)

			break;
		if (slave->phy)
		if (slave->phy)
			phy_disconnect(slave->phy);
			phy_disconnect(slave->phy);
		list_del(&slave->slave_list);
		list_del(&slave->slave_list);