From e74dfeba964519ca38ea095567282971f73a1e99 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 3 May 2021 13:48:52 +0200 Subject: fastboot: handle ill-named partitions gracefully Users can configure a partition name of bbu-something that would conflict at fastboot init time with a barebox update "something" handler. Current behavior is to silently ignore all remaining barebox update handlers. It would be better to complain loudly and to skip only the entries actually conflicting. Do so. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20210503114901.13095-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- common/fastboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/fastboot.c b/common/fastboot.c index a394d07e28..c8576a8d97 100644 --- a/common/fastboot.c +++ b/common/fastboot.c @@ -158,10 +158,12 @@ static int fastboot_add_bbu_variables(struct bbu_handler *handler, void *ctx) name = basprintf("bbu-%s", handler->name); ret = file_list_add_entry(fb->files, name, handler->devicefile, 0); + if (ret) + pr_warn("duplicate partition name %s\n", name); free(name); - return ret; + return 0; } int fastboot_generic_init(struct fastboot *fb, bool export_bbu) -- cgit v1.2.3