From patchwork Tue Apr 20 01:03:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 424540 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp3199549jaf; Mon, 19 Apr 2021 18:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv3yTJ3EeeC8wZrqlmW4uF8PDowwnt73lQlGzqa/24vy2vOGXPuU3hqZb3x0cLtmpVD9Tx X-Received: by 2002:a17:906:3e4a:: with SMTP id t10mr24415477eji.553.1618880623751; Mon, 19 Apr 2021 18:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618880623; cv=none; d=google.com; s=arc-20160816; b=hNZh4SA0dkyIyiZVtBw3cFUPI7B288iTkezFD3IydG6O6rsG0+/eN81C9fsgxY9WOI n6AzF9+gASyVJHpt1db3tSrSgT0wehPAC1PopMUpUED3YPFYrCpkKRgli3jtWQw7edim APmgym7iiDyJIwMouwLjYZtKFCTFC8LkihuLrNBIew7MUXiP8DtokyeNNOLHyubH425B h4pFoW8C4SaNqdLr/6gDQWvLQPNton6hhK/5QEcPMMfu9CtWS5mqOgPJ0tZ1ulJlgpCn MNMeTp1KJkCUtYSRruap1MXGZIVL6qHf9PIaQysCajiM6ziigHqLcqTzSO9/z5MSZUlH ZBkQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=ixbov/CF3c3rANVMskAvBZgRWQg3aVtOP2BgsTrHS9U=; b=anE5JS9BeECnSotiQKe3QFiGsVnWfkgJP01sbMRy9465ZeIlzkiNRO7+sKKvxJlcpe Jl131+arhkGnWK8cj9sE0Gl+6TwiJnZ7cKcj0EgOkm99P226QIOBq8GmyAKwguTKC2BI fNVoH/j3M07mY7N/t2oStllus+nHjZsCcqImHIJ0fhbbDR36BQTYEQ9/YXgWuTDU//Yx Mwxguuh5w3cIUX5Izw5gEwOn1tjYp9zv2HMJv5kK6F9Dh2GCksjMtThiFxk9g+dNRsRj 5JpSNULMq2wdGgHXmuqezjfwXuBh1dk27gwltibg4m6iR/96pzAlXMqc2/G8588qFj4i eBWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v5TSjrNu; 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 8si15308538ejx.637.2021.04.19.18.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 18:03:43 -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=v5TSjrNu; 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 F278682A85; Tue, 20 Apr 2021 03:03:39 +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="v5TSjrNu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F83781E5A; Tue, 20 Apr 2021 03:03:38 +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-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 106A881E5A for ; Tue, 20 Apr 2021 03:03:34 +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=takahiro.akashi@linaro.org Received: by mail-pj1-x1036.google.com with SMTP id k23-20020a17090a5917b02901043e35ad4aso21396026pji.3 for ; Mon, 19 Apr 2021 18:03:33 -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:mime-version :content-transfer-encoding; bh=ixbov/CF3c3rANVMskAvBZgRWQg3aVtOP2BgsTrHS9U=; b=v5TSjrNuPCsieuLmJwxM8SVyWOP4g7HLJ6FtPjm3QUq3GlhXSmYspURzfr7ZIQJ0Pu NsmWxL7ARgOR5Clwvael/hOPRoxmMElAbgq1OVOfHt8DOGbHn6QWEsO7WSwdTL9j4xUj +V3Vezl3yWE9uXsS3zeVlH9ulELIBU5vDdkdK6NVmlLM6I842oPSY1CzHueDciVUBI+q 860hLivgnWVvzW/GwPRJZuHZ54HK/gA0SOWg07UH6H60AX2lv1Tn0AmjG25HeNj56WX1 9fQl8iut4QiUorGob83DIPgGf6qouRjG8FTBiEtjvulYXwwOIv9DxYpZdPHpJT/42twN YUzg== 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:mime-version :content-transfer-encoding; bh=ixbov/CF3c3rANVMskAvBZgRWQg3aVtOP2BgsTrHS9U=; b=CgvS+6a04c9MhDEU+ZvddTUhbLlWldpbv7w1nK/u4DIr7vR8FQm0poe/FohdaSCgmh ceqY5UiFhjGbf44z0EM1IlYtvJDGyAmYUjtCWm7W2PC1ek/FfBMj2wGLnTemctjsXzfA +Nnh+CFjpvS7/PiwSlwn4EflTudFIMyRGj0OupdBm5FbmUmj5B2SwWAaivKmZ9oHhmaY nk6wUrdH7in+nez4rtmR1FJYApByXr/Q6fjTSdvkwVoYUw9/sSDUs/N3px+pHgzjLqre 6UCwpasBcHqr/PLT+OQly5IwP3/wz2qvcxLA0ZuNK11djr6wIqRiuS7X3Y+5sUBJtWIN 3fLQ== X-Gm-Message-State: AOAM533wxrdEBRzqIvKGvnJDJcO7CoONb47IvY7Dha086bXR/y4QjoWR 2WxmTm+uqBYZQ2VwujOTPAG9hA== X-Received: by 2002:a17:902:b785:b029:eb:7a1b:5016 with SMTP id e5-20020a170902b785b02900eb7a1b5016mr24976926pls.51.1618880612458; Mon, 19 Apr 2021 18:03:32 -0700 (PDT) Received: from localhost.localdomain (p784a44d5.tkyea130.ap.so-net.ne.jp. [120.74.68.213]) by smtp.gmail.com with ESMTPSA id l1sm14222842pgt.29.2021.04.19.18.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 18:03:31 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: trini@konsulko.com, sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH] efi_loader: capsule: return a corret error code at find_boot_device() Date: Tue, 20 Apr 2021 10:03:16 +0900 Message-Id: <20210420010316.9716-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.31.0 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.102.4 at phobos.denx.de X-Virus-Status: Clean In case of failure at efi_get_variable_int("BootOrder"), we should skip examining boot option variables and return an appropriate error code which is the one the function returned. Fixes: CID 331153 Code maintainability issues (UNUSED_VALUE) Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.0 Reviewed-by: Heinrich Schuchardt diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 691eda5e0d14..2d10f47bff24 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -685,7 +685,6 @@ skip: efi_free_pool(boot_dev); boot_dev = NULL; } -out: if (boot_dev) { u16 *path_str; @@ -703,6 +702,7 @@ out: } else { ret = EFI_NOT_FOUND; } +out: free(boot_order); return ret;