Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Eric Biggers and committed by
Mikulas Patocka
0be6c2b1 d1c3b6b8

+6 -14
+6 -14
drivers/md/dm-crypt.c
··· 110 110 const char *opts); 111 111 void (*dtr)(struct crypt_config *cc); 112 112 int (*init)(struct crypt_config *cc); 113 - int (*wipe)(struct crypt_config *cc); 113 + void (*wipe)(struct crypt_config *cc); 114 114 int (*generator)(struct crypt_config *cc, u8 *iv, 115 115 struct dm_crypt_request *dmreq); 116 116 int (*post)(struct crypt_config *cc, u8 *iv, ··· 508 508 return 0; 509 509 } 510 510 511 - static int crypt_iv_lmk_wipe(struct crypt_config *cc) 511 + static void crypt_iv_lmk_wipe(struct crypt_config *cc) 512 512 { 513 513 struct iv_lmk_private *lmk = &cc->iv_gen_private.lmk; 514 514 515 515 if (lmk->seed) 516 516 memset(lmk->seed, 0, LMK_SEED_SIZE); 517 - 518 - return 0; 519 517 } 520 518 521 519 static void crypt_iv_lmk_one(struct crypt_config *cc, u8 *iv, ··· 627 629 return 0; 628 630 } 629 631 630 - static int crypt_iv_tcw_wipe(struct crypt_config *cc) 632 + static void crypt_iv_tcw_wipe(struct crypt_config *cc) 631 633 { 632 634 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; 633 635 634 636 memset(tcw->iv_seed, 0, cc->iv_size); 635 637 memset(tcw->whitening, 0, TCW_WHITENING_SIZE); 636 - 637 - return 0; 638 638 } 639 639 640 640 static void crypt_iv_tcw_whitening(struct crypt_config *cc, ··· 1011 1015 return aes_prepareenckey(elephant->key, &cc->key[key_offset], cc->key_extra_size); 1012 1016 } 1013 1017 1014 - static int crypt_iv_elephant_wipe(struct crypt_config *cc) 1018 + static void crypt_iv_elephant_wipe(struct crypt_config *cc) 1015 1019 { 1016 1020 struct iv_elephant_private *elephant = &cc->iv_gen_private.elephant; 1017 1021 1018 1022 memzero_explicit(elephant->key, sizeof(*elephant->key)); 1019 - return 0; 1020 1023 } 1021 1024 1022 1025 static const struct crypt_iv_operations crypt_iv_plain_ops = { ··· 2643 2648 get_random_bytes(&cc->key, cc->key_size); 2644 2649 2645 2650 /* Wipe IV private keys */ 2646 - if (cc->iv_gen_ops && cc->iv_gen_ops->wipe) { 2647 - r = cc->iv_gen_ops->wipe(cc); 2648 - if (r) 2649 - return r; 2650 - } 2651 + if (cc->iv_gen_ops && cc->iv_gen_ops->wipe) 2652 + cc->iv_gen_ops->wipe(cc); 2651 2653 2652 2654 kfree_sensitive(cc->key_string); 2653 2655 cc->key_string = NULL;