]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rkcommon.c: Drop pointless assignment
authorSimon Glass <sjg@chromium.org>
Wed, 7 Jun 2017 16:28:47 +0000 (10:28 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 12 Jun 2017 12:38:12 +0000 (08:38 -0400)
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)
tools/rkcommon.c

index fd95abc79aed5533d578e93a7e9d2a5ba0ca1074..a583c0caa0d5d098eb25079f5fe1efb1808e3217 100644 (file)
@@ -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