From patchwork Tue Jan 31 18:34:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 9548005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2229D60415 for ; Tue, 31 Jan 2017 18:34:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1330C280F4 for ; Tue, 31 Jan 2017 18:34:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06DD0282E8; Tue, 31 Jan 2017 18:34:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59D78280F4 for ; Tue, 31 Jan 2017 18:34:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cYdGL-0000A3-4A; Tue, 31 Jan 2017 18:34:41 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cYdGK-00009w-3M for tpmdd-devel@lists.sourceforge.net; Tue, 31 Jan 2017 18:34:40 +0000 X-ACL-Warn: Received: from mga11.intel.com ([192.55.52.93]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cYdGJ-0007Z7-9a for tpmdd-devel@lists.sourceforge.net; Tue, 31 Jan 2017 18:34:40 +0000 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 31 Jan 2017 10:34:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,315,1477983600"; d="scan'208";a="59633747" Received: from mbrennan-mobl3.ger.corp.intel.com (HELO localhost) ([10.252.3.129]) by fmsmga005.fm.intel.com with ESMTP; 31 Jan 2017 10:34:30 -0800 From: Jarkko Sakkinen To: tpmdd-devel@lists.sourceforge.net Date: Tue, 31 Jan 2017 20:34:28 +0200 Message-Id: <20170131183428.9472-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.9.3 X-Headers-End: 1cYdGJ-0007Z7-9a Cc: open list , linux-security-module@vger.kernel.org Subject: [tpmdd-devel] [PATCH] tpm, tpm_crb: fix a type error X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP Fixes: 422eac3f7dea ("tpm_crb: fix mapping of the buffers") Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_crb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 86f355b..4db7922 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -304,7 +304,7 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, u32 pa_high, pa_low; u64 cmd_pa; u32 cmd_size; - u64 rsp_pa; + __le64 rsp_pa; u32 rsp_size; int ret; @@ -352,11 +352,11 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, } memcpy_fromio(&rsp_pa, &priv->cca->rsp_pa, 8); - rsp_pa = le64_to_cpu(rsp_pa); rsp_size = ioread32(&priv->cca->rsp_size); - if (cmd_pa != rsp_pa) { - priv->rsp = crb_map_res(dev, priv, &io_res, rsp_pa, rsp_size); + if (cmd_pa != le64_to_cpu(rsp_pa)) { + priv->rsp = crb_map_res(dev, priv, &io_res, + le64_to_cpu(rsp_pa), rsp_size); ret = PTR_ERR_OR_ZERO(priv->rsp); goto out; }