From patchwork Tue Jun 13 13:23:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 691982 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp417431wru; Tue, 13 Jun 2023 06:23:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Y9TD0estosRFZZKNSunRndkFQaI6RjIeob4RL2oiPUpwYCH+W4sOe7LM2jRr8iaHyGNuE X-Received: by 2002:a17:902:d2c7:b0:1af:9c06:22e5 with SMTP id n7-20020a170902d2c700b001af9c0622e5mr10313866plc.69.1686662619588; Tue, 13 Jun 2023 06:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686662619; cv=none; d=google.com; s=arc-20160816; b=ne2A+i9ureN1COdkgeNCP1tvfhFXq7+Vxzk0wy94Kc0j21adzKZKnjF1dtKL+57XVg kZs4jkuarwpabKCS7pKQhYVrYmkECoEeSUqZuAgOexrfcCCJnU/7QULJDzdzC/VmZU8S Bd8pG7oAMoE1IMSmO3TdT+zkWjVRKkSUeAFeBX+NV5eFb1iQb7VtTuXvLAdG3zyE9ggq GQj8Gg6rkqNuuFThc6YZLwo4ZgKixFLtPHUQmZHngjPcgkU32D1UkdMMMjrFCiJ5bL0K ooDjMpCqFszz/xaKdaacZyr5x4PmsHgUap9j2vIBj1p9/ixau9pGHLjJc39/C5DgkLVR gZag== 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=7u4CFgRV5rrMH1xksadqzU4dyXZdkqfUy3LSq8oJA2s=; b=KXLR1c9kPuZFP1LS66hzvzyK9qDJXbVg8+j+3a5OS+Lz3N5WNBu9AWErtCOm2BvS5o O+o0CfqZ1FKKvzzF/0CpgtrBoHYCXwb8SqBsQXflTkKVlhakjneOZxKE7OJcEX97PjZd RO7l8HInpoN8kd3fttxtNGzdPMsopxa5CmO7mm1CLepjVv+8yNy4yUZYeluVW6QmKmC5 3Q3I8K54Bxu5Pkgihq/kuZvSsbVPPQy8K+WnGc5rzOzfQ5i2vov+0A/8xhdhwqBb/7FA 4VHUJ3YqcVyxF7jNjK/c5J1mu7I+VkAB1EJD/gnz99owZy7LvAAXTn04mlIo557rCST6 Tt1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hYzRuCJR; 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 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 q5-20020a170902eb8500b001ae42afbf93si2227852plg.450.2023.06.13.06.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 06:23:39 -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=hYzRuCJR; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42A92862E8; Tue, 13 Jun 2023 15:23:20 +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="hYzRuCJR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F4268628C; Tue, 13 Jun 2023 15:23:17 +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-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 11174862E2 for ; Tue, 13 Jun 2023 15:23:15 +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-x334.google.com with SMTP id 5b1f17b1804b1-3f8cc042ea9so5614525e9.2 for ; Tue, 13 Jun 2023 06:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686662594; x=1689254594; 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=7u4CFgRV5rrMH1xksadqzU4dyXZdkqfUy3LSq8oJA2s=; b=hYzRuCJRnqSXa7oQVTvHiJI3WNsxwX8Y65xPGrR+ZKXNpxog/oaEuQrtVQjzlClvb3 /PClW69TIAlu32EgXlR69MZ7ki4/Is1ujeZEnoyhsCr0lSIeNVHboVVqK29k1tLeFKv2 2uIxbygm6DqnDWBbGYUnva5Jxaw4u0FrOu+xM+HeeRMG4dahJjDCJg6VVNqCzROZcoBd ZHIvDKKbPsheH1hrbihe22NnjSFAA6XdwOSPO+MKYBkpNsXc4OJfXg2Ek9xYQ/pfdhx3 Tbhvw9if50R0pY1sajnIcDaqXu5SGRfP7LFJDYh7/GTCf/wgYapFsMBRDvYUdUcOX9LP G4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686662594; x=1689254594; 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=7u4CFgRV5rrMH1xksadqzU4dyXZdkqfUy3LSq8oJA2s=; b=AGFQoZlvXjv1wOMGqao0olQ3+JkbTDRzAAN8rZP5BS+tkVSgZIVuTXwqp0VSopmeG1 YxRvG4h4wg6orgREsIQGWsmSz5s0CBmxiFKnK5Zenwe4jVj/CbVGXc7nxlFaH7uv5n3O /jY11QzCmmWmUIJNOeFbwqg46vePJyUBptHdR21HAGi75uxBbZoBKWGOH6yne35SEV9g seXfnRBdAgjVieeN/JupeNf0ZMMqB3SX8LT3fKa5EoXj8TCLot+x//3n2NiL08A4ZmGk ZxVP39jwxbq12gLS3d7r5wjHJGQLTvR3Bo5gSEQM0urmBU5y1EN4Zsb3pxvJ3C//ugrB bmVg== X-Gm-Message-State: AC+VfDzNWLCPwlKsmR8WO3WOgOmYZORmWX2MUJfCLbm4NjypATongSp1 22dF8K7EDxokYPIN2VCfZuQpBT4bxogg5L4yUNztGg== X-Received: by 2002:a1c:4c15:0:b0:3f1:70a2:ceb5 with SMTP id z21-20020a1c4c15000000b003f170a2ceb5mr8043336wmf.13.1686662594530; Tue, 13 Jun 2023 06:23:14 -0700 (PDT) Received: from localhost.localdomain (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id q25-20020a7bce99000000b003f17848673fsm14410930wmj.27.2023.06.13.06.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 06:23:14 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH] efi_selftests: fix protocol repeated selftesting Date: Tue, 13 Jun 2023 16:23:06 +0300 Message-Id: <20230613132306.83940-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230613132306.83940-1-ilias.apalodimas@linaro.org> References: <20230613132306.83940-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 Running the protocols selftest more than one times fails with => setenv efi_selftest 'manage protocols' && bootefi selftest Testing EFI API implementation Selected test: 'manage protocols' Setting up 'manage protocols' Setting up 'manage protocols' succeeded Executing 'manage protocols' Executing 'manage protocols' succeeded Tearing down 'manage protocols' Tearing down 'manage protocols' succeeded Summary: 0 failures => bootefi selftest Testing EFI API implementation Selected test: 'manage protocols' Setting up 'manage protocols' lib/efi_selftest/efi_selftest_manageprotocols.c(88): ERROR: InstallProtocolInterface failed lib/efi_selftest/efi_selftest.c(89): ERROR: Setting up 'manage protocols' failed Tearing down 'manage protocols' Tearing down 'manage protocols' succeeded Summary: 1 failures The reason is that we don't set the handles to NULL after deleting and freeing them. As a result the subsequent protocol installation will try to use an existing handle which we just removed that from our object list. Signed-off-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt --- lib/efi_selftest/efi_selftest_manageprotocols.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/efi_selftest/efi_selftest_manageprotocols.c b/lib/efi_selftest/efi_selftest_manageprotocols.c index 8edb1e4d4671..097b2ae35456 100644 --- a/lib/efi_selftest/efi_selftest_manageprotocols.c +++ b/lib/efi_selftest/efi_selftest_manageprotocols.c @@ -79,6 +79,8 @@ static int setup(const efi_handle_t img_handle, efi_status_t ret; efi_handle_t handle; + handle1 = NULL; + handle2 = NULL; boottime = systable->boottime; ret = boottime->install_protocol_interface(&handle1, &guid3,