From: Simon Glass Date: Mon, 4 May 2015 17:31:07 +0000 (-0600) Subject: sandbox: Correct error handling in state_read_file() X-Git-Tag: v2015.07-rc2~218 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d73125cb8e2e43e6476642206e0fec7c83b486c9;p=oweals%2Fu-boot.git sandbox: Correct error handling in state_read_file() This function should return a useful error for U-Boot, rather than -1. Signed-off-by: Simon Glass Reviewed-by: Joe Hershberger --- diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 033958ce74..cae731c8f1 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -51,7 +51,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname) ret = os_get_filesize(fname, &size); if (ret < 0) { printf("Cannot find sandbox state file '%s'\n", fname); - return ret; + return -ENOENT; } state->state_fdt = os_malloc(size); if (!state->state_fdt) {