Skip to content

Commit faad98f

Browse files
RoelKluinherbertx
authored andcommitted
crypto: geode-aes - access .cip instead of .blk in cipher mode
The fallback code in cipher mode touch the union fallback.blk instead of fallback.cip. This is wrong because we use the cipher and not the blockcipher. This did not show any side effects yet because both types / structs contain the same element right now. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent d7ac769 commit faad98f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/crypto/geode-aes.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ static int geode_setkey_cip(struct crypto_tfm *tfm, const u8 *key,
135135
/*
136136
* The requested key size is not supported by HW, do a fallback
137137
*/
138-
op->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
139-
op->fallback.blk->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK);
138+
op->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
139+
op->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK);
140140

141141
ret = crypto_cipher_setkey(op->fallback.cip, key, len);
142142
if (ret) {
@@ -263,7 +263,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm)
263263

264264
if (IS_ERR(op->fallback.cip)) {
265265
printk(KERN_ERR "Error allocating fallback algo %s\n", name);
266-
return PTR_ERR(op->fallback.blk);
266+
return PTR_ERR(op->fallback.cip);
267267
}
268268

269269
return 0;

0 commit comments

Comments
 (0)