Fix problems found by Coverity scan.

This commit is contained in:
Milan Broz
2018-07-19 13:53:35 +02:00
parent 1112da76f1
commit 561d9ac2bc
2 changed files with 9 additions and 14 deletions

View File

@@ -2110,22 +2110,17 @@ static int action_token(void)
return r;
}
switch (action) {
case ADD: /* adds only luks2-keyring type */
r = _token_add(cd);
break;
case REMOVE:
if (action == ADD)
r = _token_add(cd); /* adds only luks2-keyring type */
else if (action == REMOVE)
r = _token_remove(cd);
break;
case IMPORT:
else if (action == IMPORT)
r = _token_import(cd);
break;
case EXPORT:
else if (action == EXPORT)
r = _token_export(cd);
break;
default:
else {
log_dbg("Internal token action error.");
r = EINVAL;
r = -EINVAL;
}
crypt_free(cd);