diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-30 12:16:09 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-30 12:19:08 +0100 |
commit | 21ec7b89cce2b080f45f56255831f7b5a03bb1e5 (patch) | |
tree | 35d7b522f4f5e6c26228c97733a054355e857fae /common/globalvar.c | |
parent | 89ad75d8a64394a9ffd873c9b717f6a007c4617e (diff) | |
download | barebox-21ec7b89cce2b080f45f56255831f7b5a03bb1e5.tar.gz barebox-21ec7b89cce2b080f45f56255831f7b5a03bb1e5.tar.xz |
common: globalvar: fix removing multiple nvvars with wildcards
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@pengutronix.de>
Cc:
Diffstat (limited to 'common/globalvar.c')
-rw-r--r-- | common/globalvar.c | 5 |
1 files 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) |