Skip to content

Commit 7785a9e

Browse files
damien-lemoalsnitm
authored andcommitted
dm crypt: Initialize crypto wait structures
Use the DECLARE_CRYPTO_WAIT() macro to properly initialize the crypto wait structures declared on stack before their use with crypto_wait_req(). Fixes: 39d13a1 ("dm crypt: reuse eboiv skcipher for IV generation") Fixes: bbb1658 ("dm crypt: Implement Elephant diffuser for Bitlocker compatibility") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
1 parent c322ee9 commit 7785a9e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/md/dm-crypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static int crypt_iv_eboiv_gen(struct crypt_config *cc, u8 *iv,
739739
u8 buf[MAX_CIPHER_BLOCKSIZE] __aligned(__alignof__(__le64));
740740
struct skcipher_request *req;
741741
struct scatterlist src, dst;
742-
struct crypto_wait wait;
742+
DECLARE_CRYPTO_WAIT(wait);
743743
int err;
744744

745745
req = skcipher_request_alloc(any_tfm(cc), GFP_NOIO);
@@ -936,7 +936,7 @@ static int crypt_iv_elephant(struct crypt_config *cc, struct dm_crypt_request *d
936936
u8 *es, *ks, *data, *data2, *data_offset;
937937
struct skcipher_request *req;
938938
struct scatterlist *sg, *sg2, src, dst;
939-
struct crypto_wait wait;
939+
DECLARE_CRYPTO_WAIT(wait);
940940
int i, r;
941941

942942
req = skcipher_request_alloc(elephant->tfm, GFP_NOIO);

0 commit comments

Comments
 (0)