summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2023-05-24 11:35:29 +0200
committerMike Snitzer <snitzer@kernel.org>2023-06-17 00:24:13 +0200
commit2a32897c840be1c0a0525f4279b365781acfba24 (patch)
treea2e1f5930f2b92e714b0a657c02954a66fc23095 /drivers/md/dm-crypt.c
parentdm thin: update .io_hints methods to not require handling discards last (diff)
downloadlinux-2a32897c840be1c0a0525f4279b365781acfba24.tar.xz
linux-2a32897c840be1c0a0525f4279b365781acfba24.zip
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: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index dbf13bd1d219..98622a15df30 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -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);
if (ret < 0) {
ti->error = "Invalid AEAD cipher spec";
- return -ENOMEM;
+ return ret;
}
}