Merge pull request #9971 from JacobBarthelmeh/linuxkm

Use ENOMEM return and add goto out on AAD error with linuxkm
This commit is contained in:
Daniel Pouzzner
2026-03-16 11:43:15 -05:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -872,6 +872,7 @@ static int wolfkdriv_gcm_work(device_t dev, wolfkdriv_session_t * session,
if (error) {
error = EINVAL;
goto gcm_work_out;
}
}
else {
+4 -4
View File
@@ -296,7 +296,7 @@ static int km_AesInitCommon(
if (! ctx->aes_encrypt) {
pr_err("%s: allocation of %zu bytes for encryption key failed.\n",
name, sizeof(*ctx->aes_encrypt));
err = -MEMORY_E;
err = -ENOMEM;
goto out;
}
@@ -319,7 +319,7 @@ static int km_AesInitCommon(
if (! ctx->aes_decrypt) {
pr_err("%s: allocation of %zu bytes for decryption key failed.\n",
name, sizeof(*ctx->aes_decrypt));
err = -MEMORY_E;
err = -ENOMEM;
goto out;
}
@@ -341,7 +341,7 @@ static int km_AesInitCommon(
if (! ctx->aes_encrypt_C) {
pr_err("%s: allocation of %zu bytes for encryption key failed.\n",
name, sizeof(*ctx->aes_encrypt_C));
err = -MEMORY_E;
err = -ENOMEM;
goto out;
}
@@ -1577,7 +1577,7 @@ static int km_AesXtsInitCommon(struct km_AesXtsCtx * ctx, const char * name)
ctx->aesXts = (XtsAes *)malloc(sizeof(*ctx->aesXts));
if (! ctx->aesXts)
return -MEMORY_E;
return -ENOMEM;
err = wc_AesXtsInit(ctx->aesXts, NULL, INVALID_DEVID);