summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2021-06-23 20:40:47 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2021-06-23 22:58:16 -0500
commit2ae138d289ec765dde3c58fb66a5a8e56b26b6c5 (patch)
treef8f17d3903f16e58ef45d8942c7d017cae8e430b /net
parentbad069367cccb7cc349a652c015ec1bc67820879 (diff)
net: eth-uclass: call stop only for active devices
Currently stop is being called unconditionally without even checking if start is called which will result in crash where multiple instances are present and stop gets called even without calling start. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'net')
-rw-r--r--net/eth-uclass.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index e1b9fbd14a..bb4c362ede 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -590,7 +590,8 @@ static int eth_pre_remove(struct udevice *dev)
{
struct eth_pdata *pdata = dev->platdata;
- eth_get_ops(dev)->stop(dev);
+ if (eth_is_active(dev))
+ eth_get_ops(dev)->stop(dev);
/* clear the MAC address */
memset(pdata->enetaddr, 0, ARP_HLEN);