]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/miiphyutil.c
spl: mmc: raw: Try to load u-boot if Linux image is not found
[people/ms/u-boot.git] / common / miiphyutil.c
index e499b588368fd9dcf9f04a6619976923e9d30a53..7e41957185072123a81468309081ec4586730867 100644 (file)
@@ -114,6 +114,8 @@ void miiphy_register(const char *name,
        if (new_dev == NULL || ldev == NULL) {
                printf("miiphy_register: cannot allocate memory for '%s'\n",
                        name);
+               free(ldev);
+               mdio_free(new_dev);
                return;
        }
 
@@ -159,7 +161,7 @@ void mdio_free(struct mii_dev *bus)
 
 int mdio_register(struct mii_dev *bus)
 {
-       if (!bus || !bus->name || !bus->read || !bus->write)
+       if (!bus || !bus->read || !bus->write)
                return -1;
 
        /* check if we have unique name */