Skip to content

Commit b6f4810

Browse files
authored
Merge pull request #9996 from sameehj/linuxkm-fix
linuxkm/lkcapi_aes_glue.c: fix scatterwalk_map error handling in AesG…
2 parents 63f6f05 + e96dc36 commit b6f4810

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

linuxkm/lkcapi_aes_glue.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,12 +1148,11 @@ static int AesGcmCrypt_1(struct aead_request *req, int decrypt_p, int rfc4106_p)
11481148
assoc = scatterwalk_map(&assocSgWalk);
11491149
#endif
11501150
if (unlikely(IS_ERR(assoc))) {
1151+
err = (int)PTR_ERR(assoc);
11511152
pr_err("%s: scatterwalk_map failed: %ld\n",
11521153
crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm)),
11531154
PTR_ERR(assoc));
1154-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
1155-
scatterwalk_unmap(&assocSgWalk);
1156-
#endif
1155+
assoc = NULL;
11571156
goto out;
11581157
}
11591158
}
@@ -1355,12 +1354,11 @@ static int AesGcmCrypt_1(struct aead_request *req, int decrypt_p, int rfc4106_p)
13551354
in_map = scatterwalk_map(&in_walk);
13561355
#endif
13571356
if (unlikely(IS_ERR(in_map))) {
1357+
err = (int)PTR_ERR(in_map);
13581358
pr_err("%s: scatterwalk_map failed: %ld\n",
13591359
crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm)),
1360-
PTR_ERR(assoc));
1361-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0)
1360+
PTR_ERR(in_map));
13621361
in_map = NULL;
1363-
#endif
13641362
goto out;
13651363
}
13661364
assoc = in_map;
@@ -1374,12 +1372,11 @@ static int AesGcmCrypt_1(struct aead_request *req, int decrypt_p, int rfc4106_p)
13741372
out_map = scatterwalk_map(&out_walk);
13751373
#endif
13761374
if (unlikely(IS_ERR(out_map))) {
1375+
err = (int)PTR_ERR(out_map);
13771376
pr_err("%s: scatterwalk_map failed: %ld\n",
13781377
crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm)),
1379-
PTR_ERR(assoc));
1380-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0)
1378+
PTR_ERR(out_map));
13811379
out_map = NULL;
1382-
#endif
13831380
goto out;
13841381
}
13851382
out_text = out_map + req->assoclen;

0 commit comments

Comments
 (0)