From patchwork Mon Jul 12 09:05:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 473070 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2746487jao; Mon, 12 Jul 2021 02:05:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLaKfkn+HhJRAHhDakdKYgtLTlhroHAPKnheteEejqFHi3fr+Ih6ehCzkth6LiiwE3oPsM X-Received: by 2002:a17:906:1997:: with SMTP id g23mr938386ejd.304.1626080730163; Mon, 12 Jul 2021 02:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626080730; cv=none; d=google.com; s=arc-20160816; b=NjlEYEVcyO0nR/euii/C0sij2hU0k2u8LN+Ix//XS9jrL+rxtSBKBfSUfppDuZK7aJ iWlkv9z+DxWMMoZ3rZXhbGr3tbRNbmsxJmmbHejEdRCB/DF1dbypnY4ZzvyI9+lQN4pv cG/pCpFJJTyMVzzrGwSMjHaEW0tdSEbAGkNym21ZrCXtFosZ6o5RU7vn1vYIzJDRIxTC DfirtNRfZ6ULD3KYnUYoLtCSpwDiuO3UxHo7NT0G2nSpZ0Lzmzhg4WNOq/dHIokFvSbR nWFCyUgNupeKo+D77yT+YxBz70Ywd3OaDAhotxVJ48iMBriP6Ol0J9PxQHcYy1YEvVdM KcJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:date:subject:cc:to:from :dkim-signature; bh=Raa64paajBmIQs6ychZF6Bb1yErGSWGlJiRuNARhkZk=; b=qEAre/XX2VzpzDgluXqsxENGnijIodu76da/kHPeJBpSoTojBNlsmQXNegwAx7F13h FLxQansIPAjxNX8Ygt1XWuBMTrTWhY9END1jyKBGrYH7NvCLSjk6z3E1J212kA+hdJLx wgkCagPUqnsZg3CDM/nwSRSzWys09ozewqZ0Kml4BZXduDll3nBCL9u7vPNIcnhQMQaQ ckbRG5LNLPb5tbXDr7m9BnVNJZZ78t8zojBNa1bScucAFgP9YPDcEZ7+EfjMqDdQR4pd 17vMZZ8Ujv+i2pN6vK3OTi/slef9gf4OmL55adN1ZgvPtemCs71TdQ72AqflyiaQSszJ PVRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q2BJr7bM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f25si15437792edu.543.2021.07.12.02.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 02:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q2BJr7bM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C4EA82C89; Mon, 12 Jul 2021 11:05:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="q2BJr7bM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5370282C8A; Mon, 12 Jul 2021 11:05:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7D72D82C88 for ; Mon, 12 Jul 2021 11:05:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pj1-x102a.google.com with SMTP id me13-20020a17090b17cdb0290173bac8b9c9so1809201pjb.3 for ; Mon, 12 Jul 2021 02:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=Raa64paajBmIQs6ychZF6Bb1yErGSWGlJiRuNARhkZk=; b=q2BJr7bMTTjv1tX7ZWVsl+dAUuC/ijSr1uG/GqJWISnGfnuRnYJNPT2rJ1PkcDZ1VP amnExpG3eo4o458rpr6/hmwvGqQhUWH933HOzylMIDtGuZjbuj4kMi9T+VYMQvpJSmtu gxvSxsnLnlapvOC2lc6BUwTLEc3XyiVe7TxRuPGky0oQUiFp2/DlkS25NqMqQUoOBubz XTqRVkkmuX/A0LsHi5um024FpTdhjYIyf96742Ilx93ucQdfVGL8vV1xFXnUmwdqtl5o Tlg7ag8OEqhdcq7Y2K4S64nuulmoHnOU+ks+Oe163ElKr4mDFgF9h93lhdOQt4t6ZAVj mEfQ== 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:user-agent :mime-version:content-transfer-encoding; bh=Raa64paajBmIQs6ychZF6Bb1yErGSWGlJiRuNARhkZk=; b=T6ktfgyxyEZv1rcEgd+3V0yrU8G+vbj7rsEVkyYZ7alISCLWes03zDZ/JrzO5TE/EL NuWx4tpS4qsTD78MwtLRVTNusrWqAe23kAn6ZqfpzjETBNivLUUyxo8FgOWzIgLeg1S9 HC4V81y2TN9e4WzkYXsyfXw8I/EKd5kGM6TyitWzOj3TW5A0xKvLPJkLUxRkzCld4/1L XrPuTm0Kg9mgVpsVdCfUI9g7CxCKxokvgEb1YVIM2EZJiY2y14xr3MAPV8GsP4/Qc1Z5 YpYWJQNz/JdtrnGexRdv76H0GbTpF4t2FuWYKtmH37gJccHKCgQR8WlJ+YaK9WcC4BJa dD2w== X-Gm-Message-State: AOAM531I4vmxbidAPahihy5gNQNLsk2VXaL94LGE7j/fGr5s2MZNmK+p agEksiYg6TqXIxMqII27sGLKCg== X-Received: by 2002:a17:90a:c89:: with SMTP id v9mr53654445pja.175.1626080720716; Mon, 12 Jul 2021 02:05:20 -0700 (PDT) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id g9sm11382676pfr.133.2021.07.12.02.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 02:05:20 -0700 (PDT) From: Masami Hiramatsu To: Heinrich Schuchardt Cc: Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , u-boot@lists.denx.de Subject: [PATCH] efi_loader: Fix to set bootdev_root correctly if bootdev found Date: Mon, 12 Jul 2021 18:05:17 +0900 Message-Id: <162608071685.188144.16073566533117803794.stgit@localhost> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Fix find_boot_device() to set bootdev_root if it finds the bootdev from BootNext. Currently it sets the bootdev_root only when it finds bootdev from BootOrder. Fixes: c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by: Masami Hiramatsu --- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 50bed32bfb..b736f4ef9e 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -632,7 +632,7 @@ static efi_status_t find_boot_device(void) ret = get_dp_device(boot_var16, &boot_dev); if (ret == EFI_SUCCESS) { if (device_is_present_and_system_part(boot_dev)) { - goto out; + goto found; } else { efi_free_pool(boot_dev); boot_dev = NULL; @@ -675,6 +675,7 @@ skip: efi_free_pool(boot_dev); boot_dev = NULL; } +found: if (boot_dev) { u16 *path_str;