[PATCH] common: globalvar: fix removing multiple nvvars with wildcards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nvvar_remove takes wildcards, so it can remove multiple variables. This
means we cannot return after the first loop iteration, but instead must
continue.

Fixes: 609d3edc3ad9 (common: globvar: let nvvar_remove() report non-existing variable)

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Cc:
---
 common/globalvar.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index ee756e5140..77b89c1791 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -247,6 +247,7 @@ int nvvar_remove(const char *name)
 {
 	struct param_d *p, *tmp;
 	char *fname;
+	int ret = -ENOENT;
 
 	if (!IS_ENABLED(CONFIG_NVVAR))
 		return -ENOSYS;
@@ -262,10 +263,10 @@ int nvvar_remove(const char *name)
 		unlink(fname);
 		free(fname);
 
-		return 0;
+		ret = 0;
 	}
 
-	return -ENOENT;
+	return ret;
 }
 
 int nvvar_load(void)
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux