From patchwork Fri Jan 26 10:22:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10186211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A6A6602C8 for ; Fri, 26 Jan 2018 15:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5942429894 for ; Fri, 26 Jan 2018 15:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DB0029A80; Fri, 26 Jan 2018 15:05:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA3B629894 for ; Fri, 26 Jan 2018 15:05:14 +0000 (UTC) Received: from localhost ([::1]:60521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef5Z3-0006KO-NW for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Jan 2018 10:05:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef5UW-00039D-Hq for qemu-devel@nongnu.org; Fri, 26 Jan 2018 10:00:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef5US-00053Q-AC for qemu-devel@nongnu.org; Fri, 26 Jan 2018 10:00:32 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:37358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ef5US-000533-37 for qemu-devel@nongnu.org; Fri, 26 Jan 2018 10:00:28 -0500 Received: by mail-lf0-x244.google.com with SMTP id 63so1046270lfv.4 for ; Fri, 26 Jan 2018 07:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VIDteNO2icMOcay3uowqM0DGLsLbzvgdq6E76QSOO8c=; b=vRxR52KbgooAIH3z9jcvw5Y2VQVS/Ex5wNjYlSVuiuGn3uXN/YeoEvag/wdS71U1bm /DGUxpOeUWM2mTd7oc22HAuDJRvyWACZDc6udj/o5feqr5b6mDmxru9+tFUTJ+PIso8i xK6BUiFWSIGWbn1qHTraideBtw/wMkJ2X2ISvbmT/bWk+bcUIOVMW+b0OoGRHSgu9v9x pHXr0dcZKLIWNYYVrK9Dd9S9EVr4v42sIqasPjYXgJtdY0lKccQnR2mWruGAtV/Qj85+ v3Hd3sOZc/PizkRdBVL/695ZNRpzXmcGkJrpVRVX77lEfagmkCV0jzABlCdNVjYoN3Cb X5BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VIDteNO2icMOcay3uowqM0DGLsLbzvgdq6E76QSOO8c=; b=i7crJZkKgfkFp4iaaNasIylwyoPLVfbIHCu9ZlqgIsKPuXn1RKUZW0sV6E6bucLCb6 eSiAVRD5XB2CRrNhYQv7WNvCZ4GOAEABzKcGYLQDNxN0408BPxn+UDL+sG8ettEc0K8u n1uj32T9zPlzmuTAvcqzjG82I1ZnRq4E0TKRtrShedUp7PRXKtAr3pmlBS94R8daGdwW d6wDhhrujBaCXU6YjTdusx+/fPWLdyit/OMviPUiViwdR7/HAE/K2OswxWsZpb5nXalA 6/RWYz3t8s1PdZM+2euBrvPl1PixkjJ2tuCrhk6XM3cobOmtpe/+L6ERRh4fzH9te3X5 YAvw== X-Gm-Message-State: AKwxytcjC69+38bFbdkFuJr3ttoIXRsdevXeXEOAgun3wIJXGnoVIb5+ JmDR45VupXCbymDBkcWEu55/Iw== X-Google-Smtp-Source: AH8x224qAdTH/TuPeGCjoGjUOJa2y2EJgc98uhmc2erafY3D7C8lPWuWHV2Nt73YoXCkO+RXCuFLtg== X-Received: by 10.25.159.200 with SMTP id i191mr7151370lfe.84.1516962166127; Fri, 26 Jan 2018 02:22:46 -0800 (PST) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id f18sm71441ljf.80.2018.01.26.02.22.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 02:22:45 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 26 Jan 2018 11:22:34 +0100 Message-Id: <1516962162-25680-2-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516962162-25680-1-git-send-email-edgar.iglesias@gmail.com> References: <1516962162-25680-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL v2 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: sai.pavan.boddu@xilinx.com, edgar.iglesias@xilinx.com, alistai@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alistair Francis 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é Reviewed-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- 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 457a08a..35bfeda 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); }