From patchwork Mon May 10 18:19:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 433164 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3088486jao; Mon, 10 May 2021 11:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKnpTMKV2kLLPlNh3DJsThdG8JDQgHYK+uoypRyauC2ITexOYTYI0+gMHVIqXovKEK8j0e X-Received: by 2002:a17:906:b6c5:: with SMTP id ec5mr27342367ejb.290.1620670764014; Mon, 10 May 2021 11:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620670764; cv=none; d=google.com; s=arc-20160816; b=E7Mdt2HX7PbvfXzQApjcR+Ml3ePSAwmUtjuDVyBgr5mLuhDLr5bTW0x2GIZGW0BDac DO+jzdKq0cI5KWhDy7YtHs0zHDb8qqIqWsaa/Ej/35uBE/72oJq1tTDdyL0QKxJQvVkq 34I/g4uOP+KWEwP4kNPKcSD6ixpMypcMhC0QMvgTuBo9kPFoH7q1pf5RTZCh/uCkmo2s Jg/Iw9amLNu6j0O0FQ187q5Qu2CtW/Wyg8+Wy3m4FQd6NQ8JZ81eI0PFZt54Cg1DC8wR A0FrVPC3g0GFE3OFWLoPdixp9A6lrjHRhXA1DSF4G8RbZ+GL3y0VvNQmvbBI5Dr2GOsy 75mQ== 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=xwHk+mk5zrSQ1kVfSnMJYFycZ7Jw7vQP/MJ7E5iVXHk=; b=wuRwXQhIhNY6kxenncJabXyOF9iQLfX7W/TpvkJ/o6sjMFFY4W/JHeH8NHvvGIKvYt Hr3jf4i2cpGJDuphroNSErDeXKkpEy3FaOTYfFopkEgs6xaEQZF2t2ftkc9udSd4XoRY SIrfEhdnfmokHVe1l8/gopEiBDOfXePm94mkx3qNpnZX78RaphOSEPNVqKSjhGRV96s1 k5Zqc8wOID5NwsLyZmxiHK2yQ6PceUnoalcG2D3LsFRptj/647Xzk+J8o86L8glEQdb+ GTo+AAljXbinKtj0NaUUE49NWVjiAfUSHkIo4LTARqLa+Ajjm37w2zn+GWhDlMkg22NN Kzng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kDvMDnds; 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 z15si17307714ejr.8.2021.05.10.11.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 11:19:24 -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=kDvMDnds; 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 CA31882ED0; Mon, 10 May 2021 20:19:21 +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="kDvMDnds"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2C4A82ED0; Mon, 10 May 2021 20:19:20 +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-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 4F60982ED5 for ; Mon, 10 May 2021 20:19:18 +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-wr1-x434.google.com with SMTP id h4so17572967wrt.12 for ; Mon, 10 May 2021 11:19:18 -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=xwHk+mk5zrSQ1kVfSnMJYFycZ7Jw7vQP/MJ7E5iVXHk=; b=kDvMDndslhYsBF/SAqEd+4Ty5ia/wrYJCW8DYFq9kRMn36InbAv0p6WCqCUmjIMUBO bTYpk3CeN/2EClg50MxARah/HfpsuEiuH+r8+0sfs9Yrz6FEOUTjxHv3X8VrBuP+Fp8o 32p3VzGEgDtQewTco3oX9ZpoHTcwDVxx0jwEmxVr/OJ+gehS5m3Qt99Rl2Cx0joja862 TJ7tDSmYGeGSJFbFeG+tq354TOkSuedXG7oUi2eFhp75I5yWr7Gy7MLmj08Px5v+EAvA VAPrdu7HYnTnZ/4JGMnrsv9r8gKNdrV3kNMbRQw7hLchJz5hKecav1E9j9BFTs5+MWm9 QRyg== 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=xwHk+mk5zrSQ1kVfSnMJYFycZ7Jw7vQP/MJ7E5iVXHk=; b=Ja1fhUgQj2sDOGi66606l9DD8egpZiewa6thGsFix2ujp1S8jZB1Ry3ojRW0B49jo/ VZTcxygOE3IlGP5ANHYOC1GJDeDNlRwk3gA5xB+IFfIvZiBTPF0snKQTgFkPBOGCjfxO WsLNorKULvXvYJqvW75tC8F2E1xrxZweEO2fvk+rRp0oUvSWgEgK2PJrYFaXk4UOPm4G T8JHEOYDzs871MADvKyDLmINfJh1vFfBCcqz+K3bRL4jJLof4qqieUEyru1pdjZNsyT2 LHqV/NOwlENRFCmTrnfU1WZy0k2D2kGkyzuLjOxeHBZPfK7dICSvU3DLGJDlZEg7uUbQ 3J6g== X-Gm-Message-State: AOAM532utMp828sn3HvBTGa7NzpN9PTG1CjpQLK9mys6uTyiUxZlRSlY W0e7igY6khOdrZwc62Vib0GUdze3C5AWww== X-Received: by 2002:a5d:4845:: with SMTP id n5mr32639600wrs.290.1620670757852; Mon, 10 May 2021 11:19:17 -0700 (PDT) Received: from apalos.home ([2a02:587:466e:1389:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id q20sm1002419wmq.2.2021.05.10.11.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 11:19:17 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: Ilias Apalodimas , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH] efi_loader: Uninstall the TCG2 protocol if logging s-crtm fails Date: Mon, 10 May 2021 21:19:14 +0300 Message-Id: <20210510181915.233918-1-ilias.apalodimas@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 Instead of just failing, clean up the installed config table and EventLog memory if logging an s-crtm event fails during the protocol installation Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_tcg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.0 Reviewed-by: Heinrich Schuchardt diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 570cc746ed4e..8f8a26e7b7ae 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -1113,7 +1113,7 @@ efi_status_t efi_tcg2_register(void) ret = efi_append_scrtm_version(dev); if (ret != EFI_SUCCESS) - goto out; + goto fail; ret = efi_add_protocol(efi_root, &efi_guid_tcg2_protocol, (void *)&efi_tcg2_protocol);