summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-07 16:28:47 (GMT)
committerTom Rini <trini@konsulko.com>2017-06-12 12:38:12 (GMT)
commit22929bec528f42c1a7fbcd76adeea8daed9ba55c (patch)
tree225d5c0349f1e80d86b2058c09a6a0795132cb72 /tools
parentbaa7d345fb2a7aaee31af6d77f2a790e89864af6 (diff)
downloadu-boot-22929bec528f42c1a7fbcd76adeea8daed9ba55c.tar.xz
rkcommon.c: Drop pointless assignment
Assigning a variable to itself is not necessary. Drop this and also add a check for malloc() failure. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 161418) Fixes: 111bcc4 (rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for RK3399)
Diffstat (limited to 'tools')
-rw-r--r--tools/rkcommon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index fd95abc..a583c0c 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -380,8 +380,9 @@ int rkcommon_vrec_header(struct image_tool_params *params,
/* Allocate, clear and install the header */
tparams->hdr = malloc(tparams->header_size);
+ if (!tparams->hdr)
+ return -ENOMEM;
memset(tparams->hdr, 0, tparams->header_size);
- tparams->header_size = tparams->header_size;
/*
* If someone passed in 0 for the alignment, we'd better handle