Skip to content

Commit 0be6c2b

Browse files
Eric BiggersMikulas Patocka
authored andcommitted
dm-crypt: Make crypt_iv_operations::wipe return void
Since all implementations of crypt_iv_operations::wipe now return 0, change the return type to void. Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent d1c3b6b commit 0be6c2b

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

drivers/md/dm-crypt.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct crypt_iv_operations {
110110
const char *opts);
111111
void (*dtr)(struct crypt_config *cc);
112112
int (*init)(struct crypt_config *cc);
113-
int (*wipe)(struct crypt_config *cc);
113+
void (*wipe)(struct crypt_config *cc);
114114
int (*generator)(struct crypt_config *cc, u8 *iv,
115115
struct dm_crypt_request *dmreq);
116116
int (*post)(struct crypt_config *cc, u8 *iv,
@@ -508,14 +508,12 @@ static int crypt_iv_lmk_init(struct crypt_config *cc)
508508
return 0;
509509
}
510510

511-
static int crypt_iv_lmk_wipe(struct crypt_config *cc)
511+
static void crypt_iv_lmk_wipe(struct crypt_config *cc)
512512
{
513513
struct iv_lmk_private *lmk = &cc->iv_gen_private.lmk;
514514

515515
if (lmk->seed)
516516
memset(lmk->seed, 0, LMK_SEED_SIZE);
517-
518-
return 0;
519517
}
520518

521519
static void crypt_iv_lmk_one(struct crypt_config *cc, u8 *iv,
@@ -629,14 +627,12 @@ static int crypt_iv_tcw_init(struct crypt_config *cc)
629627
return 0;
630628
}
631629

632-
static int crypt_iv_tcw_wipe(struct crypt_config *cc)
630+
static void crypt_iv_tcw_wipe(struct crypt_config *cc)
633631
{
634632
struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw;
635633

636634
memset(tcw->iv_seed, 0, cc->iv_size);
637635
memset(tcw->whitening, 0, TCW_WHITENING_SIZE);
638-
639-
return 0;
640636
}
641637

642638
static void crypt_iv_tcw_whitening(struct crypt_config *cc,
@@ -1015,12 +1011,11 @@ static int crypt_iv_elephant_init(struct crypt_config *cc)
10151011
return aes_prepareenckey(elephant->key, &cc->key[key_offset], cc->key_extra_size);
10161012
}
10171013

1018-
static int crypt_iv_elephant_wipe(struct crypt_config *cc)
1014+
static void crypt_iv_elephant_wipe(struct crypt_config *cc)
10191015
{
10201016
struct iv_elephant_private *elephant = &cc->iv_gen_private.elephant;
10211017

10221018
memzero_explicit(elephant->key, sizeof(*elephant->key));
1023-
return 0;
10241019
}
10251020

10261021
static const struct crypt_iv_operations crypt_iv_plain_ops = {
@@ -2648,11 +2643,8 @@ static int crypt_wipe_key(struct crypt_config *cc)
26482643
get_random_bytes(&cc->key, cc->key_size);
26492644

26502645
/* Wipe IV private keys */
2651-
if (cc->iv_gen_ops && cc->iv_gen_ops->wipe) {
2652-
r = cc->iv_gen_ops->wipe(cc);
2653-
if (r)
2654-
return r;
2655-
}
2646+
if (cc->iv_gen_ops && cc->iv_gen_ops->wipe)
2647+
cc->iv_gen_ops->wipe(cc);
26562648

26572649
kfree_sensitive(cc->key_string);
26582650
cc->key_string = NULL;

0 commit comments

Comments
 (0)