forked from wolfSSL/wolfssl
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:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user