summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorIgnat Korchagin <ignat@cloudflare.com>2021-01-19 20:40:15 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-27 11:54:52 +0100
commitc5f23645ab51025d196966198cf318209fe2b290 (patch)
tree0dcacea429c0aa13bbe83b636e17b5dd9557e9a0 /drivers/md
parent367733db7a10c5575d0bd3bb8f6fa7d26c6ed904 (diff)
dm crypt: fix copy and paste bug in crypt_alloc_req_aead
commit 004b8ae9e2de55ca7857ba8471209dd3179e088c upstream. In commit d68b29584c25 ("dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq") code was incorrectly copy and pasted from crypt_alloc_req_skcipher()'s crypto request allocation code to crypt_alloc_req_aead(). It is OK from runtime perspective as both simple encryption request pointer and AEAD request pointer are part of a union, but may confuse code reviewers. Fixes: d68b29584c25 ("dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq") Cc: stable@vger.kernel.org # v5.9+ Reported-by: Pavel Machek <pavel@denx.de> Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 89de9cde0202..875823d6ee7e 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1481,9 +1481,9 @@ static int crypt_alloc_req_skcipher(struct crypt_config *cc,
static int crypt_alloc_req_aead(struct crypt_config *cc,
struct convert_context *ctx)
{
- if (!ctx->r.req) {
- ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
- if (!ctx->r.req)
+ if (!ctx->r.req_aead) {
+ ctx->r.req_aead = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
+ if (!ctx->r.req_aead)
return -ENOMEM;
}