Commit 6d2c15ea authored by Milan Broz's avatar Milan Broz

Avoid some clang warnings.

parent 4b8f91d0
......@@ -616,7 +616,7 @@ int dm_create_device(const char *name,
else if (dmd->target == DM_VERITY)
table_params = get_dm_verity_params(dmd->u.verity.vp, dmd);
if (!table_params)
if (!table_params || !type)
return -EINVAL;
return _dm_create_device(name, type, dmd->data_device, dmd->flags,
......
......@@ -218,7 +218,8 @@ int LUKS_hdr_restore(
}
r = LUKS_read_phdr_backup(backup_file, device, &hdr_file, 0, ctx);
buffer_size = hdr_file.payloadOffset << SECTOR_SHIFT;
if (!r)
buffer_size = hdr_file.payloadOffset << SECTOR_SHIFT;
if (r || buffer_size < LUKS_ALIGN_KEYSLOTS) {
log_err(ctx, _("Backup file doesn't contain valid LUKS header.\n"));
......
......@@ -308,13 +308,13 @@ static int VERITY_create_or_verify_hash(struct crypt_device *cd,
if (levels)
r = create_or_verify(cd, hash_file, NULL,
hash_level_block[levels - 1], hash_block_size,
0, 0,
0, hash_block_size,
1, version, hash_name, verify,
calculated_digest, digest_size, salt, salt_size);
else
r = create_or_verify(cd, data_file, NULL,
0, data_block_size,
0, 0,
0, hash_block_size,
data_file_blocks, version, hash_name, verify,
calculated_digest, digest_size, salt, salt_size);
out:
......
......@@ -484,6 +484,7 @@ static int run_action(struct action_type *action)
int main(int argc, const char **argv)
{
static char *popt_tmp;
static const char *null_action_argv[] = {NULL};
static struct poptOption popt_help_options[] = {
{ NULL, '\0', POPT_ARG_CALLBACK, help, 0, NULL, NULL },
{ "help", '?', POPT_ARG_NONE, NULL, 0, N_("Show this help message"), NULL },
......@@ -509,7 +510,7 @@ int main(int argc, const char **argv)
poptContext popt_context;
struct action_type *action;
const char *aname, *null_action_argv[] = {NULL};
const char *aname;
int r;
crypt_set_log_callback(NULL, _log, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment