From patchwork Mon May 10 18:15:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 433163 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3085295jao; Mon, 10 May 2021 11:15:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTTvoOMobAOBE5Aw60Apj4XeQo8qxyXOq2lrRISdJ7U3sTw8oxSSq2ERuczgVXVmYKcgO2 X-Received: by 2002:a17:906:b2c1:: with SMTP id cf1mr17904909ejb.544.1620670518637; Mon, 10 May 2021 11:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620670518; cv=none; d=google.com; s=arc-20160816; b=X3lbxoTuEZLMB6SVFM6mCZkiKjgO2VjPQ6dyVZoIzxxbTZAnGzZ6uwcYmRHrRjBAXo CW2ATRZroK2xM9lsx0xq2dwl7MNM8uIgDXEWTfkmRt6ridbAHxfXQHVc1Mw/YOHlEUZz dO4uJUyoBGd+Dzc9xq6zs4mLgrDpLyPCkejX7J09kuYSeWep//1YqzkC/24u0lGwgKHV Ehb38n8zISoDE7H5uSE6x9xLy+Ou1AIyt/P8xW66WU2pr3KXE9iHglfNu1p6czNb6/Hr SQ/xp6ts71EkFZlBgeWcR5NW69oP66PZxYWQ7W+vrBLkqraZN1OflIEXs8awbhc6w3Oh hfTg== 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=K4SHx9g0LzHqP2iZ9Df5UeCVztKGz2PKDjpsap4Gf70=; b=Xaqv8oKsx++dPXYfZiQyjmYeVcQHpUupMKwY4aSpek3/2ihLBktLgmcobXNOzm057M EI1XWt0yGOcKwQ8eAXmeC5jpcwjGNFmC+S+7ZS8VHiLrllTr2/iwu+jukpTmYWIvVlDI wELUkD7S5R2BlKctRMNEXr4FGgkS6l1aL3/RE7rlLz5J2LtRPkDwqrz/RGIWIljI1IsK Eceab4Sr63OAg9hwfBzHjpovNftkDeuaP4K7AXbgoN/Q3oCXrqDuTcGfM+wgdlTYwbHr 8splQNJT/H6ucdAla0ezWg7dAxsfZ68LPZpxV3qG3cR6DvEm6bisuWmrWdqCzNuoHaub JbFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hafD5+PX; 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 u10si2788947ejx.639.2021.05.10.11.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 11:15:18 -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=hafD5+PX; 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 2DE7B82ED0; Mon, 10 May 2021 20:15:17 +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="hafD5+PX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4926782ED5; Mon, 10 May 2021 20:15:15 +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-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 5BB1A82E6B for ; Mon, 10 May 2021 20:15:12 +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-x433.google.com with SMTP id m9so17600134wrx.3 for ; Mon, 10 May 2021 11:15:12 -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=K4SHx9g0LzHqP2iZ9Df5UeCVztKGz2PKDjpsap4Gf70=; b=hafD5+PX04luUet5/CgY2NBE+OV/ha/8uv/WhIThezYNS/o83GoDcIR0rZ39sH4xcq rIipgH7xLa+sCe+EprPKm+LX8+OO8ABZXbRuDpi2JGrX880HXo4Tr6GSIfTCMnQabr66 +lhPRHFgZFfhgBsEsCUT0N3ObQjBCK0jI82LrcK6cHlNb0uxtKBkl0ngQlQqLB18jx1U +0MIWX2WmqB6QCPxpZi/9QsV+Ay6BrSbbWJXmIgTOQEodT82Hdc43+xZIn1Hqp8zID4R 2sMwfH4juuwjKjNG1eT5z+kkdKKdV/K1j75OUnrWPC23sw5n0oLRd966UYctGmbF9+OC 1VwQ== 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=K4SHx9g0LzHqP2iZ9Df5UeCVztKGz2PKDjpsap4Gf70=; b=Om7vyIb/VQMuAKv3Ob1iBzATr53Xh+IwRJe2bjGx45Gvl0qMJiPltCwrFlVKT8SosQ OAqJG+u28ZwvJX1YmHEDetrxiKp+/esq2HmepI/N0RRHtVlRFiOYuKFuzC1xZTC/HinU Z3tIMtVRU2C7aZ/EJ8KFTrFXT/U10fuUMJRB/tYIZ/QBiAgOaz5qWRuUoULH1HgFOuvg xfCueXH38PZzg3HSOC3YSQOy79qJcE5yX4lVr3AptRSZwq2ZZ7i1bz2bP4fb1CU2k1Fc 39Geb2VVR8Ug4HooZT1t0xMKoOitvhLIcGHf08o3f18Rw1uFcLcYiqmPU3gcjL2sFbka BLxw== X-Gm-Message-State: AOAM531w7MMA8g4zycC4djyVJcdegA31vl4mjTrs2Qyuxnk3NCEMpBoL ZLYxa/CpUHJsjsUjbyxS8QkJLw== X-Received: by 2002:a5d:6687:: with SMTP id l7mr33018507wru.235.1620670511940; Mon, 10 May 2021 11:15:11 -0700 (PDT) Received: from apalos.home ([2a02:587:466e:1389:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id x65sm345929wmg.36.2021.05.10.11.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 11:15:11 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: Ilias Apalodimas , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH] efi_loader: Clean up tcg2 once in case of failure Date: Mon, 10 May 2021 21:15:08 +0300 Message-Id: <20210510181509.233610-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 efi_init_event_log() calls tcg2_uninit() in case of failure. We can skip that since the function is called on efi_tcg2_register() which also cleans up if an error occurs Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_tcg2.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.31.0 Reviewed-by: Heinrich Schuchardt diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 94e8f22bbb69..570cc746ed4e 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -1053,12 +1053,8 @@ static efi_status_t efi_init_event_log(void) event_log.last_event_size = event_log.pos; ret = create_final_event(); - if (ret != EFI_SUCCESS) - goto out; - return EFI_SUCCESS; out: - tcg2_uninit(); return ret; }