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: 1468147 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=v5TSjrNu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FPQRk2GGZz9vDw for ; Tue, 20 Apr 2021 11:03:46 +1000 (AEST) 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-Google-Smtp-Source: ABdhPJyPUBZ+PN4yaioOIb36rjPCYMrbEd8RhKnGNxYEHmOd+QXojRKjpveXs7OBU0QH0LQ4oTTnZA== 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 Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;