Commit 2a32897c authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

dm crypt: fix crypt_ctr_cipher_new return value on invalid AEAD cipher

If the user specifies invalid AEAD cipher, dm-crypt should return the
error returned from crypt_ctr_auth_spec, not -ENOMEM.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent ef6953fb
...@@ -2908,7 +2908,7 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key ...@@ -2908,7 +2908,7 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key
ret = crypt_ctr_auth_cipher(cc, cipher_api); ret = crypt_ctr_auth_cipher(cc, cipher_api);
if (ret < 0) { if (ret < 0) {
ti->error = "Invalid AEAD cipher spec"; ti->error = "Invalid AEAD cipher spec";
return -ENOMEM; return ret;
} }
} }
......
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