Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0CE7C07E99 for ; Mon, 12 Jul 2021 09:05:29 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 17709610A6 for ; Mon, 12 Jul 2021 09:05:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17709610A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de 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) 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-Google-Smtp-Source: ABdhPJwKqWwGBPuGNFAhM6FGx1/qZDiptVYcaE141kmxITfN4bkc2a4joylh2iMgmTBzd2s22jtE2w== 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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(-) 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;