mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-09 23:30:54 +02:00
Merge pull request #9971 from JacobBarthelmeh/linuxkm
Use ENOMEM return and add goto out on AAD error with linuxkm
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user