From patchwork Mon Jan 22 19:43:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 864374 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="C0pmQglx"; 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 3zQMS73h7Rz9s4s for ; Tue, 23 Jan 2018 06:48:39 +1100 (AEDT) Received: from localhost ([::1]:33686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edi57-0006md-44 for incoming@patchwork.ozlabs.org; Mon, 22 Jan 2018 14:48:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edi4F-0006li-AO for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edi4E-0005kQ-Dp for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:47:43 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:33537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edi4E-0005j0-8T; Mon, 22 Jan 2018 14:47:42 -0500 Received: by mail-pg0-x241.google.com with SMTP id u1so7889315pgr.0; Mon, 22 Jan 2018 11:47:42 -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 :mime-version:content-transfer-encoding; bh=BDDG8Xz03COM+89QzfPV0TQGkFrkjTbvo09xeOTyOnY=; b=C0pmQglxd2Cz8/epOtRA+Go38XyWgBEWymbq8xiL8Z5gMoHPMeQcVPSr70fsADd06p pGr+D/ApvRYNqq5qYmUjI4eaSezCkuMLpOp48i2QrBIom5LjxqrxAiBYHNtvvLZfMJoM 6URwNess1MVaEV9LyD/v8zYDRKSdfzce5It+HpDpQ9tCXKFb/9eJ6GrGbmNANxrZVrQ6 vUlLtZQWQmULl/O7E0DnsE2dpSCfHA9SdPkGM/7jnzwdVC/pjaHW0A4aOW39P2Irffrw ilG2GmmrghFoj08tkLa+bb3TB1Q3vP4uR9jmDh4/a4XP54Hwk5+4MrHE6gMYVLOHZI16 mm4w== 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:mime-version:content-transfer-encoding; bh=BDDG8Xz03COM+89QzfPV0TQGkFrkjTbvo09xeOTyOnY=; b=Q+7rDoiw97/EnJvE9Z1Fs4VPuy37vtQvYdZWLssCjOeXQy2zh+OWwmG0Q9IUa/+9+l eGxdAOKgYDppPiTNiV2X3Vi9kd868v+/51zvvYM6M0kscbQi/lzk8/cRlqWtwCHUWDRj 0tqGN7uNVpGFJqJgDRtAF8b+JVz4FWZ6Vt0hLHR/im0nXpV3fic0ulb2hReZtWlPycM0 B4twOee4jCQdGe8Vsosj6pYPOsmrBr6CqHt0ImqhOvBtHffiEYon1/PFL0UfMdzJwZ7K qjWnowLYm/WXF4MYes8qJZIW/5ljjZ9X/ouPMkWDBjoKLkzjGJKc2XbxbVkZy9h/bpxw lUpQ== X-Gm-Message-State: AKwxytcALnWrOurbYNcM4ks1qQpFUCb4fhTEBs7bpdAhDHzNlr82/beU 6aCtUyf1n0F0oa66Odc8H4GAu6fT X-Google-Smtp-Source: AH8x224tsIXEK2T7NNZXBWPflDDDimCWIJh2q9LhetZpgHgABBLc0Rt4BIcBjKeJubVK4pcuVlrisg== X-Received: by 10.98.141.199 with SMTP id p68mr8650908pfk.25.1516650460725; Mon, 22 Jan 2018 11:47:40 -0800 (PST) Received: from localhost ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id 8sm2435995pfh.170.2018.01.22.11.47.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 11:47:39 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org, edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com Date: Mon, 22 Jan 2018 11:43:16 -0800 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH v7 1/9] microblaze: boot.c: Don't try to find NULL file 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); }