diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-19 08:09:20 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-22 12:27:23 +0200 |
commit | 75926bc33d2ec53e7b81cdfd68b66725fd8cd5ac (patch) | |
tree | 27334d014e12ee1886b5f68a09c2e48ea49e148e | |
parent | 0c2fccceb625655a0cbae40bfca3449914ff02cf (diff) | |
download | barebox-75926bc33d2ec53e7b81cdfd68b66725fd8cd5ac.tar.gz barebox-75926bc33d2ec53e7b81cdfd68b66725fd8cd5ac.tar.xz |
nv: Use dev_remove_param to delete nv variable
dev_remove_param() is exactly for the purpose of removing a device
parameter, so use this function instead of open coding the
functionality.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/globalvar.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/globalvar.c b/common/globalvar.c index 4110a067a3..a2eaaa0223 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -304,13 +304,12 @@ int nvvar_remove(const char *name) return -ENOENT; fname = basprintf("/env/nv/%s", p->name); + + dev_remove_param(p); + unlink(fname); free(fname); - list_del(&p->list); - free(p->name); - free(p); - return 0; } |