Skip to content

Commit 30d8cf1

Browse files
authored
Merge pull request #9971 from JacobBarthelmeh/linuxkm
Use ENOMEM return and add goto out on AAD error with linuxkm
2 parents 7ad9c25 + b97b3da commit 30d8cf1

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

bsdkm/wolfkmod.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ static int wolfkdriv_gcm_work(device_t dev, wolfkdriv_session_t * session,
872872

873873
if (error) {
874874
error = EINVAL;
875+
goto gcm_work_out;
875876
}
876877
}
877878
else {

linuxkm/lkcapi_aes_glue.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int km_AesInitCommon(
296296
if (! ctx->aes_encrypt) {
297297
pr_err("%s: allocation of %zu bytes for encryption key failed.\n",
298298
name, sizeof(*ctx->aes_encrypt));
299-
err = -MEMORY_E;
299+
err = -ENOMEM;
300300
goto out;
301301
}
302302

@@ -319,7 +319,7 @@ static int km_AesInitCommon(
319319
if (! ctx->aes_decrypt) {
320320
pr_err("%s: allocation of %zu bytes for decryption key failed.\n",
321321
name, sizeof(*ctx->aes_decrypt));
322-
err = -MEMORY_E;
322+
err = -ENOMEM;
323323
goto out;
324324
}
325325

@@ -341,7 +341,7 @@ static int km_AesInitCommon(
341341
if (! ctx->aes_encrypt_C) {
342342
pr_err("%s: allocation of %zu bytes for encryption key failed.\n",
343343
name, sizeof(*ctx->aes_encrypt_C));
344-
err = -MEMORY_E;
344+
err = -ENOMEM;
345345
goto out;
346346
}
347347

@@ -1577,7 +1577,7 @@ static int km_AesXtsInitCommon(struct km_AesXtsCtx * ctx, const char * name)
15771577
ctx->aesXts = (XtsAes *)malloc(sizeof(*ctx->aesXts));
15781578

15791579
if (! ctx->aesXts)
1580-
return -MEMORY_E;
1580+
return -ENOMEM;
15811581

15821582
err = wc_AesXtsInit(ctx->aesXts, NULL, INVALID_DEVID);
15831583

0 commit comments

Comments
 (0)