From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 65645C77B73 for ; Tue, 6 Jun 2023 13:36:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 137A185AFF; Tue, 6 Jun 2023 15:36:26 +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="ryX6HQDk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B78085C18; Tue, 6 Jun 2023 15:36:25 +0200 (CEST) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 605FB859F2 for ; Tue, 6 Jun 2023 15:36: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=ilias.apalodimas@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f7353993cbso22928625e9.0 for ; Tue, 06 Jun 2023 06:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686058582; x=1688650582; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZAoja/pZ62JIU4rPNUT/fj1pj5wBsGqC76MFHOHVCoI=; b=ryX6HQDkFmrdocfwzaBrGlrpzCzJN0vNHnT1B2mDrivef2BhwzKvgHmCNJSLeL+o1L ckyCtDNVsATMMpZE5WAIA4CBV2/hYjFM8R3IUjY6TshdVpTIDMkM9hUUwvbsWlPg1Ws5 8NRe0vmlCqHBsjC1z0UGs3XB0VF9/dqsX6y1VsC+x38O3Kn3OWdZLaXPjZDQhFdozrT1 tWZWU436J2MDVhXofeSiMckDP2Olu0Sr0TfD48D1yv2OBAsRh9vOvgtd6/M+uBxKAAnU yy0uTqd8YNRQlbTjekPF8yE8PZJJpQ/mgHio/gka/51QnHLtXTZzF8v4CVu8mFb0mG9o tB3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686058582; x=1688650582; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZAoja/pZ62JIU4rPNUT/fj1pj5wBsGqC76MFHOHVCoI=; b=lqsCBiBH0VrgjOO5TpOqDa+cczVQ8w/RCTnsZ13QfF2LS0tUz30i1M97S81oKRKlfr JHrnRCc1UszKclOmQPVtdfpux1H4gvlWilI9K+qRMpYKRhNbc4CJZK7X5UNXT3G4+m4L HpHZW2XFPf+2PSfyt90lasblBIs5zkmFojkAkKwSfO8bpZjbq0WsPHKSybB1AKe+di0V v4fA9Yt14wD2nEPThPcNkuvusJYMpeSePUrxmL1bbdpvm0iw1HGev7UOMbQNK0gSJdoC i+tdo93me24k5fonoF0bZytjt1chw7IdLhnhJQMJrWRhyDVNrPX6pqi/OVZxanqd+Ot6 VhXw== X-Gm-Message-State: AC+VfDwsC2zyzWvHxsHs/jJ69KjnbORh94T5OfsIv9ngjyNY8+JOdh3l vLMQnMbSeF2V+CGUhFQAcwloLg== X-Google-Smtp-Source: ACHHUZ4Mb2zBlC9b//MKo4NtLsVd+UZfTz/kzFM4Qug37oMO4N09GM1ZIBk1rgeYE1TYC5k/Y1pK+g== X-Received: by 2002:a05:600c:881b:b0:3f7:ec1d:21b3 with SMTP id gy27-20020a05600c881b00b003f7ec1d21b3mr1243243wmb.5.1686058581828; Tue, 06 Jun 2023 06:36:21 -0700 (PDT) Received: from hera (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c294200b003f727764b10sm13816176wmd.4.2023.06.06.06.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 06:36:21 -0700 (PDT) Date: Tue, 6 Jun 2023 16:36:19 +0300 From: Ilias Apalodimas To: Raymond Mao Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Simon Glass , Masahisa Kojima Subject: Re: [PATCH v7 2/4] Fix incorrect return code of boot option update Message-ID: References: <20230531174515.41758-1-raymond.mao@linaro.org> <20230531174515.41758-3-raymond.mao@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230531174515.41758-3-raymond.mao@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean On Wed, May 31, 2023 at 10:45:15AM -0700, Raymond Mao wrote: > Correct the return code for out-of-memory and no boot option found > > Signed-off-by: Raymond Mao > --- > Changes in v7 > - new patch file created > > cmd/bootmenu.c | 2 +- > cmd/eficonfig.c | 2 +- > lib/efi_loader/efi_bootmgr.c | 8 ++++++-- > 3 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c > index 01daddca7b..987b16889f 100644 > --- a/cmd/bootmenu.c > +++ b/cmd/bootmenu.c > @@ -352,7 +352,7 @@ static struct bootmenu_data *bootmenu_create(int delay) > * a architecture-specific default image name such as BOOTAA64.EFI. > */ > efi_ret = efi_bootmgr_update_media_device_boot_option(); > - if (efi_ret != EFI_SUCCESS && efi_ret != EFI_NOT_FOUND) > + if (efi_ret != EFI_SUCCESS) > goto cleanup; > > ret = prepare_uefi_bootorder_entry(menu, &iter, &i); > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c > index 82a80306f4..e6e8a0a488 100644 > --- a/cmd/eficonfig.c > +++ b/cmd/eficonfig.c > @@ -2314,7 +2314,7 @@ static int do_eficonfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const a > return CMD_RET_FAILURE; > > ret = efi_bootmgr_update_media_device_boot_option(); > - if (ret != EFI_SUCCESS && ret != EFI_NOT_FOUND) > + if (ret != EFI_SUCCESS) > return ret; > > while (1) { > diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c > index 48cd5f0636..95559ad6dd 100644 > --- a/lib/efi_loader/efi_bootmgr.c > +++ b/lib/efi_loader/efi_bootmgr.c > @@ -663,11 +663,13 @@ efi_status_t efi_bootmgr_update_media_device_boot_option(void) > NULL, &count, > (efi_handle_t **)&volume_handles); > if (ret != EFI_SUCCESS) > - return ret; > + goto out; > > opt = calloc(count, sizeof(struct eficonfig_media_boot_option)); > - if (!opt) > + if (!opt) { > + ret = EFI_OUT_OF_RESOURCES; > goto out; > + } > > /* enumerate all devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL */ > ret = efi_bootmgr_enumerate_boot_option(opt, volume_handles, count); > @@ -720,5 +722,7 @@ out: > free(opt); > efi_free_pool(volume_handles); > > + if (ret == EFI_NOT_FOUND) > + return EFI_SUCCESS; > return ret; > } > -- > 2.25.1 > Reviewed-by: Ilias Apalodimas