summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/blspec.c4
-rw-r--r--common/firmware.c4
-rw-r--r--include/firmware.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/common/blspec.c b/common/blspec.c
index 6cb1fea9e8..158fd1e9a2 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -75,8 +75,7 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
const char *abspath, *devicetree, *options, *initrd, *linuximage;
const char *overlays;
const char *appendroot;
- const char *old_fws;
- char *fws;
+ char *old_fws, *fws;
struct bootm_data data = {
.dryrun = dryrun,
};
@@ -158,6 +157,7 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
of_overlay_set_basedir("/");
firmware_set_searchpath(old_fws);
+ free(old_fws);
err_out:
free((char *)data.oftree_file);
diff --git a/common/firmware.c b/common/firmware.c
index b33acff77f..b87d7da38f 100644
--- a/common/firmware.c
+++ b/common/firmware.c
@@ -224,9 +224,9 @@ out:
static char *firmware_path;
-const char *firmware_get_searchpath(void)
+char *firmware_get_searchpath(void)
{
- return firmware_path;
+ return strdup(firmware_path);
}
void firmware_set_searchpath(const char *path)
diff --git a/include/firmware.h b/include/firmware.h
index 0ffea52840..2583342230 100644
--- a/include/firmware.h
+++ b/include/firmware.h
@@ -31,7 +31,7 @@ struct firmware_mgr *firmwaremgr_find(const char *);
#ifdef CONFIG_FIRMWARE
struct firmware_mgr *firmwaremgr_find_by_node(struct device_node *np);
int firmwaremgr_load_file(struct firmware_mgr *, const char *path);
-const char *firmware_get_searchpath(void);
+char *firmware_get_searchpath(void);
void firmware_set_searchpath(const char *path);
#else
static inline struct firmware_mgr *firmwaremgr_find_by_node(struct device_node *np)
@@ -44,7 +44,7 @@ static inline int firmwaremgr_load_file(struct firmware_mgr *mgr, const char *pa
return -ENOSYS;
}
-static inline const char *firmware_get_searchpath(void)
+static inline char *firmware_get_searchpath(void)
{
return NULL;
}