summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/miiphyutil.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 0811e098b4..7e41957185 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -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;
}