From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A87EC433E2 for ; Fri, 17 Jul 2020 11:52:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20F00208DB for ; Fri, 17 Jul 2020 11:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbgGQLwi (ORCPT ); Fri, 17 Jul 2020 07:52:38 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:58392 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726013AbgGQLwi (ORCPT ); Fri, 17 Jul 2020 07:52:38 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7AD5A89B4757263A6469; Fri, 17 Jul 2020 19:52:36 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Fri, 17 Jul 2020 19:52:26 +0800 From: Hanjun Guo To: Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe CC: , Hanjun Guo Subject: [PATCH 1/3] tpm: Put the TCPA table buf after using it Date: Fri, 17 Jul 2020 19:45:46 +0800 Message-ID: <1594986348-52258-1-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used for runtime to release the table mapping, put the TCPA table buf after using it. Signed-off-by: Hanjun Guo --- drivers/char/tpm/eventlog/acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/char/tpm/eventlog/acpi.c b/drivers/char/tpm/eventlog/acpi.c index 63ada5e..e8ac30b 100644 --- a/drivers/char/tpm/eventlog/acpi.c +++ b/drivers/char/tpm/eventlog/acpi.c @@ -79,6 +79,9 @@ int tpm_read_log_acpi(struct tpm_chip *chip) start = buff->client.log_start_addr; break; } + + acpi_put_table((struct acpi_table_header *)buff); + if (!len) { dev_warn(&chip->dev, "%s: TCPA log area empty\n", __func__); return -EIO; -- 1.7.12.4