From nobody Fri Dec 19 04:38:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1585575501; cv=none; d=zohomail.com; s=zohoarc; b=fzyp2EvwDoyC7OrkK4zX/Q/4/GywuzMQmYFmL7NPyYiD4Q2sEjDGX4JrZey4MR04axqXipbAEaXytOdQd/+h789YFol3YKOYZwZ4SxR0ZZfdtuctBddjAcNnlela8R/PxEItx+EEtQniPmVY3IFVIXrM5GJeAswnCs6n0prGvGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585575501; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CbVDnPhb7KjkBF4bPw+KOLLnLSCqhHbQ8JeT9vFEYAU=; b=UmoJ1eYcbMjh6vXA8dGzTQqv5bn5e7Yv2oOoxvUdiePEXf2LookwbCgpJDtYfqmba/17tITqjCN+U9hMJ6ssO0u4ctDJM1k75t2ygqp+9t6YlmnN2H3xDRxLee0Tz03QwgeK+l+h+q+srd3PZLCwtq2czzA6m3RAbYo2w6mRpyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585575501323688.5431361271966; Mon, 30 Mar 2020 06:38:21 -0700 (PDT) Received: from localhost ([::1]:50072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIucO-00061r-1a for importer@patchew.org; Mon, 30 Mar 2020 09:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49446) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIub0-0004Ok-SP for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIuaz-00015D-Kl for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:54 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:54420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIuaz-000131-EB for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:53 -0400 Received: by mail-wm1-x342.google.com with SMTP id c81so19958971wmd.4 for ; Mon, 30 Mar 2020 06:36:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o14sm20756504wmh.22.2020.03.30.06.36.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 06:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CbVDnPhb7KjkBF4bPw+KOLLnLSCqhHbQ8JeT9vFEYAU=; b=FEwQtKwQihU/wpwY4pk9tGWNQltK+tf3DA2rwP4HutsOEWugH3PxysVLhmq0itTPFZ q4MrNmYEO9x7UgMo3qRGhOUWo0shxhxBpfel27envq76na2ylJHPV/YTtI4zmjI337oP YA0myBxLf1fh2ziRbcJz03RrNhiPrQyovTWMdkxMGzs+sH/Irrl9OJWk2cSFfCC7J63J n1NxTZYPBaa6NXLzEUI3CGDwSC2Bhw7eiyeH/WfAJwZnm7tKs4wCBD4hpRDm6zdSfKi9 KjYTzloatQZAmJy/yO6I8G/2RwqB7UkhbWW+EGIOCj7yA+GP5GytTf0p27zjjqaURwVe 5OGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CbVDnPhb7KjkBF4bPw+KOLLnLSCqhHbQ8JeT9vFEYAU=; b=quVEbbc8leD7Z3tnfT7bzrjYwcSD8sLPhbzqbf6bw2mSQnJ9yXlw1DZ4CDR2KF60vG dVT5FNu9ak5HwR5jemmc2Qb00YWU2MMScuvz8vq7m6mK0ha71+Z2wPVRP5iJAL9Uz6IK lurmYdnKeeKVPcP8k3P4k0RxJR0UKe41GrXzyM8LQwRDHh0gn6cz/KL4dH/oj8+OOQDW GdmHMMyW9WiXYm9nNkjITx6DOffuj4YzWgG9WeMLER2JBPV75e8Il3Oda46xmCqAmmcA YO/H0xlzxiNTNTb4xmzosz+0HB6rhFc+sKNW6+jZq9ofjmkmde4LV+Tacs+yEM17UeNV 6nPQ== X-Gm-Message-State: ANhLgQ0+g5SpNqan+TkaRY2aO4SPQ13fUMfx9KWRVnL5GBFUQviPeLdJ njp4jDpR4B9+RYIdmk8woNYlnLi4rXDj8g== X-Google-Smtp-Source: ADFU+vvvyCy1/1ZKMCDZfZtftq6Te6frDdDyhC0b3oLcr1Rhh79ZxoFHagKh3PhDIAY39y4u6yucWw== X-Received: by 2002:a1c:1904:: with SMTP id 4mr13149905wmz.21.1585575411598; Mon, 30 Mar 2020 06:36:51 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/6] hw/arm/orangepi: check for potential NULL pointer when calling blk_is_available Date: Mon, 30 Mar 2020 14:36:43 +0100 Message-Id: <20200330133648.22297-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200330133648.22297-1-peter.maydell@linaro.org> References: <20200330133648.22297-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Niek Linnenbank The Orange Pi PC initialization function needs to verify that the SD card block backend is usable before calling the Boot ROM setup routine. When calling blk_is_available() the input parameter should not be NULL. This commit ensures that blk_is_available is only called with non-NULL inpu= t. Reported-by: Peter Maydell Signed-off-by: Niek Linnenbank Message-id: 20200322205439.15231-1-nieklinnenbank@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/orangepi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c index 181f5badab7..a9f64c56800 100644 --- a/hw/arm/orangepi.c +++ b/hw/arm/orangepi.c @@ -104,7 +104,7 @@ static void orangepi_init(MachineState *machine) machine->ram); =20 /* Load target kernel or start using BootROM */ - if (!machine->kernel_filename && blk_is_available(blk)) { + if (!machine->kernel_filename && blk && blk_is_available(blk)) { /* Use Boot ROM to copy data from SD card to SRAM */ allwinner_h3_bootrom_setup(h3, blk); } --=20 2.20.1