projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01a0309
)
net: netcp: ethss: fix up incorrect use of list api
author
Karicheri, Muralidharan
<
[email protected]
>
Tue, 28 Jul 2015 22:20:13 +0000
(18:20 -0400)
committer
David S. Miller
<
[email protected]
>
Thu, 30 Jul 2015 01:37:40 +0000
(18:37 -0700)
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: Murali Karicheri <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/ti/netcp_ethss.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ti/netcp_ethss.c
b/drivers/net/ethernet/ti/netcp_ethss.c
index a21881219865952d907f36df1f4013d1953d9539..d11d6172941aaa91adab462d71396fb4dde25846 100644
(file)
--- a/
drivers/net/ethernet/ti/netcp_ethss.c
+++ b/
drivers/net/ethernet/ti/netcp_ethss.c
@@
-2508,10
+2508,9
@@
static void free_secondary_ports(struct gbe_priv *gbe_dev)
{
struct gbe_slave *slave;
-
for (;;
) {
+
while (!list_empty(&gbe_dev->secondary_slaves)
) {
slave = first_sec_slave(gbe_dev);
- if (!slave)
- break;
+
if (slave->phy)
phy_disconnect(slave->phy);
list_del(&slave->slave_list);