diff options
Diffstat (limited to 'common/autoboot.c')
| -rw-r--r-- | common/autoboot.c | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/common/autoboot.c b/common/autoboot.c index 6f0aeae6bf3..0a254498d40 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -4,13 +4,14 @@   * Wolfgang Denk, DENX Software Engineering, wd@denx.de.   */ -#include <common.h> +#include <config.h>  #include <autoboot.h>  #include <bootretry.h>  #include <cli.h>  #include <command.h>  #include <console.h>  #include <env.h> +#include <errno.h>  #include <fdtdec.h>  #include <hash.h>  #include <log.h> @@ -185,10 +186,15 @@ static int passwd_abort_sha256(uint64_t etime)  	ret = hash_parse_string(algo_name, sha_env_str, sha_env);  	if (ret) {  		printf("Hash %s not supported!\n", algo_name); +		free(presskey);  		return 0;  	}  	sha = malloc_cache_aligned(SHA256_SUM_LEN); +	if (!sha) { +		free(presskey); +		return -ENOMEM; +	}  	size = SHA256_SUM_LEN;  	/*  	 * We don't know how long the stop-string is, so we need to | 
