From patchwork Thu Jan 18 18:37:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 863086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gfmiMoiS"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMtCB4tF6z9s7M for ; Fri, 19 Jan 2018 05:43:50 +1100 (AEDT) Received: from localhost ([::1]:47219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFAC-0008CU-Ho for incoming@patchwork.ozlabs.org; Thu, 18 Jan 2018 13:43:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecF8j-0007TT-F0 for qemu-devel@nongnu.org; Thu, 18 Jan 2018 13:42:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecF8i-0002qj-Hv for qemu-devel@nongnu.org; Thu, 18 Jan 2018 13:42:17 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:43203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecF8i-0002pf-CP; Thu, 18 Jan 2018 13:42:16 -0500 Received: by mail-pg0-x243.google.com with SMTP id n17so7420221pgf.10; Thu, 18 Jan 2018 10:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jnjZxUo6DdDuRrFsJf0BnqEIpqJuKubvBWE4IGEwKHg=; b=gfmiMoiS8eBbJEVTQFXDPAmulJ28CX313BFYhVnVRD/YVMplCB8j990j4IIO1BsT2+ /z9vfeMT3nWzPCooXhAG3NHDV4qZ55avt4KuZGpfQ1cDiz+6oUKl+SFpU6aJgDL/uxPe lWSVNEAs1ymtunWICPvSVrxhUDJtEuMXDoa51istEsgArOceP3nkru0XpNC+GH33GMkn +14j3R7agFnsJj2PBdvDvl9SDXPMOFYGdM8+tvWacZ5aUQtx/3PteQjDvUy0ti7bFETV t+lZ3U+3yFU3GWCmzNpYZeRrwANj8ryj0/6Rh9saLGJjMYy1w70quA4g9COd/gNAyFTl 10fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jnjZxUo6DdDuRrFsJf0BnqEIpqJuKubvBWE4IGEwKHg=; b=LGk8NzTRmwJ3rUWYUCwDc2eXHjWPYQdjUUVPj43bK/AC8wH2KroNapavIAQYVURqUB rxwvoBUmM+3OLEVSH6LQKW72ob+fg9cyOIb9W55jkHQi2Vr6n7H5iaMzXNmT2wjWPHYG ji5m+8y1H6k+1OixZZYwnKP/TTAE9YqI7OMcdFb322NmfcnYu4uejNpDuELmKxnmE5te 9ZhcHwnhQ/rP1Pg6fTx9U5J5o+O2cBsOg7DEnIpVf9NCNabr/582aUAb6/NaUp/B4QBe HbfYcwwSFCKYPJcYyMxhsX3LjysNOM1SJU/wgwaWoHIMcde7amqdpRW28gML506s6NnN s8Aw== X-Gm-Message-State: AKwxyterlPHVCULphDoLWtRYhmxTBDyzsgwnKeOyrTcy1YkrG31a/Ydp DxbXKCxsylg0SeJX738OJqZqnuFExaA= X-Google-Smtp-Source: ACJfBotTyATPfni8ySpEJ45soFQm2Gxx3MnvSZmzaUqvxqeVt4sRHYlc4+Mij/c/U2glc1/qY4DcFw== X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr234424plj.36.1516300935060; Thu, 18 Jan 2018 10:42:15 -0800 (PST) Received: from localhost ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id u71sm9896785pfd.37.2018.01.18.10.42.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 10:42:14 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org, edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com Date: Thu, 18 Jan 2018 10:37:49 -0800 Message-Id: <3ddf66fa53e18ba941908bdba5e056e67ccf854b.1516300623.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH v6 1/9] microblaze: boot.c: Don't try to find NULL pointer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, qemu-arm@nongnu.org, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Previously if no device tree was passed to microblaze_load_kernel() then qemu_find_file() would try to find a NULL pointer. To avoid this put a check around qemu_find_file(). Signed-off-by: Alistair Francis Reported-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/microblaze/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 457a08a2fe..35bfeda7aa 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -124,7 +124,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, kernel_cmdline = qemu_opt_get(machine_opts, "append"); dtb_arg = qemu_opt_get(machine_opts, "dtb"); /* default to pcbios dtb as passed by machine_init */ - if (!dtb_arg) { + if (!dtb_arg && dtb_filename) { filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename); }