[PATCH] fixup! restart: give all restart handlers a descriptive name

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Sep 15 08:05:41 EDT 2020


As suggested by Sascha, allow users to pass automatically allocated
name.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/restart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/restart.c b/common/restart.c
index 3791337a7505..7bd39de8c318 100644
--- a/common/restart.c
+++ b/common/restart.c
@@ -64,7 +64,7 @@ int restart_handler_register_fn(const char *name,
 
 	rst = xzalloc(sizeof(*rst));
 
-	rst->name = name;
+	rst->name = xstrdup(name);
 	rst->restart = restart_fn;
 
 	ret = restart_handler_register(rst);
-- 
2.28.0




More information about the barebox mailing list