From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XskMa-0004Vy-KQ for qemu-devel@nongnu.org; Sun, 23 Nov 2014 22:31:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XskMV-0006js-QQ for qemu-devel@nongnu.org; Sun, 23 Nov 2014 22:30:56 -0500 From: zhanghailiang Date: Mon, 24 Nov 2014 11:30:33 +0800 Message-ID: <1416799833-9972-1-git-send-email-zhang.zhanghailiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] hw/arm/boot: fix uninitialized scalar variable warning reported by coverity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: pbonzini@redhat.com, zhanghailiang , arei.gonglei@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com Coverity reports the 'size' may be used uninitialized, but that can't happen, because the caller has checked "if (binfo->dtb_filename || binfo->get_dtb)" before call 'load_dtb'. Here we simply remove the 'if (binfo->get_dtb)' to satisfy coverity. Signed-off-by: zhanghailiang --- hw/arm/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 0014c34..4f515b5 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -352,7 +352,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, goto fail; } g_free(filename); - } else if (binfo->get_dtb) { + } else { fdt = binfo->get_dtb(binfo, &size); if (!fdt) { fprintf(stderr, "Board was unable to create a dtb blob\n"); -- 1.7.12.4