|
@@ -679,7 +679,7 @@ static int dsa_of_probe(struct device *dev)
|
|
|
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
|
|
|
if (!pd) {
|
|
|
ret = -ENOMEM;
|
|
|
- goto out_put_mdio;
|
|
|
+ goto out_put_ethernet;
|
|
|
}
|
|
|
|
|
|
dev->platform_data = pd;
|
|
@@ -773,6 +773,8 @@ out_free_chip:
|
|
|
out_free:
|
|
|
kfree(pd);
|
|
|
dev->platform_data = NULL;
|
|
|
+out_put_ethernet:
|
|
|
+ put_device(ðernet_dev->dev);
|
|
|
out_put_mdio:
|
|
|
put_device(&mdio_bus->dev);
|
|
|
return ret;
|
|
@@ -786,6 +788,7 @@ static void dsa_of_remove(struct device *dev)
|
|
|
return;
|
|
|
|
|
|
dsa_of_free_platform_data(pd);
|
|
|
+ put_device(&pd->of_netdev->dev);
|
|
|
kfree(pd);
|
|
|
}
|
|
|
#else
|