summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-20 21:11:17 +0200
committerTom Rini <trini@konsulko.com>2020-08-27 11:26:58 -0400
commitde95930946f5de3b5f43aaf4153a334d841d4f3c (patch)
tree5e8283f2ec91b7c86a688113554827d977d61c8d /lib
parent4431a9889c67f76e66aa99fb9ad9e10c014e268f (diff)
downloadu-boot-socfpga-de95930946f5de3b5f43aaf4153a334d841d4f3c.tar.gz
lib/rsa: correct check after allocation in fdt_add_bignum()
After allocating to pointer ctx we should check that pointer and not another pointer already checked above. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/rsa/rsa-sign.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 40ca1e1f57..1f0d81bd7a 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -708,7 +708,7 @@ static int fdt_add_bignum(void *blob, int noffset, const char *prop_name,
return -ENOMEM;
}
ctx = BN_CTX_new();
- if (!tmp) {
+ if (!ctx) {
fprintf(stderr, "Out of memory (bignum context)\n");
return -ENOMEM;
}