swconfig: remove useless variables, return -1 on errors

spotted with cppcheck

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>

SVN-Revision: 39170
This commit is contained in:
John Crispin
2013-12-27 21:15:20 +00:00
parent 834204bda6
commit d1156bca0a
3 changed files with 2 additions and 11 deletions

View File

@@ -178,7 +178,6 @@ swconfig_load_uci(struct switch_dev *dev, const char *name)
{
struct uci_context *ctx;
struct uci_package *p = NULL;
struct uci_element *e;
int ret = -1;
ctx = uci_alloc_context();
@@ -206,7 +205,6 @@ int main(int argc, char **argv)
struct switch_dev *dev;
struct switch_attr *a;
struct switch_val val;
int err;
int i;
int cmd = CMD_NONE;
@@ -289,6 +287,7 @@ int main(int argc, char **argv)
if(!a)
{
fprintf(stderr, "Unknown attribute \"%s\"\n", ckey);
retval = -1;
goto out;
}
}
@@ -351,5 +350,5 @@ int main(int argc, char **argv)
out:
swlib_free_all(dev);
return 0;
return retval;
}