linuxkm/lkcapi_*_glue.c: in test harnesses, fix several out-of-order NULLing of PTR_ERR-type pointers in error paths.

This commit is contained in:
Daniel Pouzzner
2025-05-01 16:55:30 -05:00
parent 937fb03f05
commit a18a8ced23
4 changed files with 8 additions and 8 deletions

View File

@ -2821,11 +2821,11 @@ static int linuxkm_test_kpp_driver(const char * driver,
if (IS_ERR(tfm)) {
pr_err("error: allocating kpp algorithm %s failed: %ld\n",
driver, PTR_ERR(tfm));
tfm = NULL;
if (PTR_ERR(tfm) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
tfm = NULL;
goto test_kpp_end;
}
@ -2833,11 +2833,11 @@ static int linuxkm_test_kpp_driver(const char * driver,
if (IS_ERR(req)) {
pr_err("error: allocating kpp request %s failed\n",
driver);
req = NULL;
if (PTR_ERR(req) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
req = NULL;
goto test_kpp_end;
}

View File

@ -804,11 +804,11 @@ static int linuxkm_test_ecdh_nist_driver(const char * driver,
if (IS_ERR(tfm)) {
pr_err("error: allocating kpp algorithm %s failed: %ld\n",
driver, PTR_ERR(tfm));
tfm = NULL;
if (PTR_ERR(tfm) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
tfm = NULL;
goto test_ecdh_nist_end;
}
@ -816,11 +816,11 @@ static int linuxkm_test_ecdh_nist_driver(const char * driver,
if (IS_ERR(req)) {
pr_err("error: allocating kpp request %s failed\n",
driver);
req = NULL;
if (PTR_ERR(req) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
req = NULL;
goto test_ecdh_nist_end;
}

View File

@ -680,11 +680,11 @@ static int linuxkm_test_ecdsa_nist_driver(const char * driver,
if (IS_ERR(tfm)) {
pr_err("error: allocating akcipher algorithm %s failed: %ld\n",
driver, PTR_ERR(tfm));
tfm = NULL;
if (PTR_ERR(tfm) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
tfm = NULL;
goto test_ecdsa_nist_end;
}
@ -692,11 +692,11 @@ static int linuxkm_test_ecdsa_nist_driver(const char * driver,
if (IS_ERR(req)) {
pr_err("error: allocating akcipher request %s failed\n",
driver);
req = NULL;
if (PTR_ERR(req) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
req = NULL;
goto test_ecdsa_nist_end;
}

View File

@ -1653,11 +1653,11 @@ static int linuxkm_test_pkcs1_driver(const char * driver, int nbits,
if (IS_ERR(tfm)) {
pr_err("error: allocating akcipher algorithm %s failed: %ld\n",
driver, PTR_ERR(tfm));
tfm = NULL;
if (PTR_ERR(tfm) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
tfm = NULL;
goto test_pkcs1_end;
}
@ -1665,11 +1665,11 @@ static int linuxkm_test_pkcs1_driver(const char * driver, int nbits,
if (IS_ERR(req)) {
pr_err("error: allocating akcipher request %s failed\n",
driver);
req = NULL;
if (PTR_ERR(req) == -ENOMEM)
test_rc = MEMORY_E;
else
test_rc = BAD_FUNC_ARG;
req = NULL;
goto test_pkcs1_end;
}