From patchwork Mon Aug 12 20:56:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 818573 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp3337wrm; Mon, 12 Aug 2024 13:57:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUi3eXwetXrHqzNHFI5cLPCXxWIlQ87aGFMnusNT4PLniTbXlLdDKVMnk372XAiRyy1EsyGpqME3q6LqCAseQnd X-Google-Smtp-Source: AGHT+IEXGBkoz3RDWVgkL/c8hJNijb176ayMbON5maXJVtcbpg7DrmxYNHt8e8M+8O7HhCyiw096 X-Received: by 2002:a17:907:efd5:b0:a7a:929f:c0cf with SMTP id a640c23a62f3a-a80ed1efeedmr112892066b.21.1723496232439; Mon, 12 Aug 2024 13:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723496232; cv=none; d=google.com; s=arc-20160816; b=y2og+9Qzr3NgUa4jsGF0thKHZhpDUBP/x5f5kDjfAoOq8SGzwWCzh8O6E7faLl6V0+ /wuYiFd73QNF/XBMGu58eFLisICcFo9JrbF7vHB9DL9I7vuy2chZwrXqHMSZ2bPxAu36 5+Ur2YLA3DbbukcfqWXBrt/vhNywZCdQo2CV2X/6l0QnlYrdOv/RZERfIr+DTAV8aiFU 44RArCaI5YhHatyQN4AqGNj5BygYY4i7Lmk01oF12726PF0ZJLuSVWUqbn6mATK/yZrt 6d5/Tn9R6s5JpTU8rzZBZpG0opYSh0nxeIMDziDm+fX1VZrLIkQNYr/p8FPZw2Vui7Ne 6v+w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1PxyyKOhIhLJM2KgJkvqItP92NBeMNvKC4AN5PkDxq8=; fh=lrmtqYFDsOI3S+I8ZACfLVds8AhopcQ75saoSqWRD08=; b=ZotyQDvbGBLbl4uyYw1wcfSMun+b+CKmV+kkQNBGiKM1Wz+WYDYWRlPFnQyQPFIcZd MWU9pjF8ePYEVzjKHL5VN2RumfnVsypNZt9eP2VVi7bOdF8dtlePvKZxqiP/a9sVj3Xw jndxDJSgtA0XZPbJ30TcRNlB5TH0LRaMFsJA4qY6LJapx1Oz26lFbzxRmMG2CqImJ+yO UoHXLYDzsoQ0RhGcN7/FLOtEvxR2k1F/GkwTCVf/MWaxQsLLj7G0CSC4RMCKzltcD8y2 +6wZ1hQQtq7920jW6XrJiMcRMU6sdbDonqMmBtC8OdGSmWm4ePrq7O2WLFByLdqb4MI8 mf9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xCzo3/fy"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a80f411d3a1si12268766b.461.2024.08.12.13.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 13:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xCzo3/fy"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D0579888C6; Mon, 12 Aug 2024 22:56:50 +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="xCzo3/fy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B54888703; Mon, 12 Aug 2024 22:56:49 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 60960866EE for ; Mon, 12 Aug 2024 22:56:46 +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-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5a1c49632deso5317732a12.2 for ; Mon, 12 Aug 2024 13:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723496206; x=1724101006; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1PxyyKOhIhLJM2KgJkvqItP92NBeMNvKC4AN5PkDxq8=; b=xCzo3/fyc4kANwIOVZik9JjffUQmMlkCYmj7pVfgxC5hqeNe3TZYJLeqPLDNKvtZHL Csyt+wzP+c1eRqTzgAU8yFBIQhzuSX2hE08t6MHapZhW35J8QrYDSyD0C3kOBjR0OvWd o8cbf0MjL/ZflcQOW8MaZdyhio6W8nWNANwJnb755Saw1HhQ3QHMPC1NcohlBBbqkP7i co/TreQ0VbuEQxFmtTocSCMxDhPgK1BhdzZ9EBYThHeCkUNUFoY2epa/VpKuxoMvwMoi f7x3RouTAHJkAscuAtB4GnVTnZwE7yl6PtiQZOox8it6+Hpz8rZL3O5CILeHv8jXAolY kogw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723496206; x=1724101006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1PxyyKOhIhLJM2KgJkvqItP92NBeMNvKC4AN5PkDxq8=; b=b+b31BdDTz6gHDCEOW+aNBsYyk0DFnQ9nySwHmEdsvZxWsfItR5C5HA3F9mHZqpcU8 CLxQUxUo8gq9QapwXY1/QgDxAcRYRtHVSaungYME1nWpnUygcLk+j4b2GtRGvFI6aOxt 9NDwgirvA/1kakqXpvRpd4rwViSabOJByDE/YEWX99N3T7LNnD4Zwg2uw2x5Kc3q2/s7 u4J/U1rh2UEjtTWMeUFHlpMujJfExZjF1GT/d4SwklA0kr0U55i497ODaqE4576mrVX1 qfIUFMYy+dC383GVHJsjaoWhp915XOsp0n3NE2FSmMDwCzmOo+/GeqokNzaN/HqKqLhB QltA== X-Forwarded-Encrypted: i=1; AJvYcCUTQ18dGJOQATbiOHdYALxnzqxR8KSJEumTQz2HShcj6cfG/WnypyyiFuvw9rdXyL9+w9KsZs4WesmLCJ59+Vp74Lq6bA== X-Gm-Message-State: AOJu0YzaaM6bNcpRONkb86t/xBOum76EWn6ElWn0bJ2eN7W0VA1vMe79 xkHethObQNvGDq9G9X8O0V1Pv91CIoGkC3iH8hmoDvMCHDSpqDPNBd9MxsH4uz4= X-Received: by 2002:a17:907:3fa3:b0:a7d:c9fa:e3b3 with SMTP id a640c23a62f3a-a80ed2ca647mr96190166b.54.1723496205337; Mon, 12 Aug 2024 13:56:45 -0700 (PDT) Received: from localhost.localdomain (ppp046103060252.access.hol.gr. [46.103.60.252]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a80f411b51esm9491966b.134.2024.08.12.13.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 13:56:44 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: kojima.masahisa@socionext.com, u-boot@lists.denx.de, akashi.tkhro@gmail.com, Ilias Apalodimas Subject: [PATCH 3/3] efi_loader: return the correct error in efi_bootmgr_release_uridp() Date: Mon, 12 Aug 2024 23:56:38 +0300 Message-ID: <20240812205638.1732159-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240812205638.1732159-1-ilias.apalodimas@linaro.org> References: <20240812205638.1732159-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 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 There's currently a chance for this function to overwrite an error if one occurred and the subsequent call to efi_uninstall_multiple_protocol_interfaces() succedded. Although this is an EFI event and we can't do much let's at least set and return the correct error Signed-off-by: Ilias Apalodimas Reviewed-by: Simon Glass --- lib/efi_loader/efi_bootmgr.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 03cdee15017d..a3aa2b8d1b92 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -388,6 +388,7 @@ err: efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx) { efi_status_t ret = EFI_SUCCESS; + efi_status_t ret2 = EFI_SUCCESS; if (!ctx) return ret; @@ -407,17 +408,18 @@ efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx) /* cleanup for PE-COFF image */ if (ctx->mem_handle) { - ret = efi_uninstall_multiple_protocol_interfaces( - ctx->mem_handle, &efi_guid_device_path, ctx->loaded_dp, - NULL); - if (ret != EFI_SUCCESS) + ret2 = efi_uninstall_multiple_protocol_interfaces(ctx->mem_handle, + &efi_guid_device_path, + ctx->loaded_dp, + NULL); + if (ret2 != EFI_SUCCESS) log_err("Uninstall device_path protocol failed\n"); } efi_free_pool(ctx->loaded_dp); free(ctx); - return ret; + return ret == EFI_SUCCESS ? ret2 : ret; } /**