From: Simon Glass Date: Wed, 7 Jun 2017 10:28:47 -0600 Subject: [U-Boot] [PATCH 10/10] rkcommon.c: Drop pointless assignment In-Reply-To: <20170607162847.16971-1-sjg@chromium.org> References: <20170607162847.16971-1-sjg@chromium.org> Message-ID: <20170607162847.16971-11-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Assigning a variable to itself is not necessary. Drop this and also add a check for malloc() failure. Signed-off-by: Simon Glass Reported-by: Coverity (CID: 161418) Fixes: 111bcc4 (rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for RK3399) --- tools/rkcommon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/rkcommon.c b/tools/rkcommon.c index 8283a740c1..de196b92af 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -259,8 +259,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 -- 2.13.0.506.g27d5fe0cd-goog