Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4793969imm; Mon, 15 Oct 2018 23:22:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV61n9hrAKYzq/xQupgFuKyWNDZN4kmiORUV7pCpEQ+u5/s1ctQLInXcca3OHetJbfmIyCR6E X-Received: by 2002:a62:5016:: with SMTP id e22-v6mr20992069pfb.30.1539670960267; Mon, 15 Oct 2018 23:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539670960; cv=none; d=google.com; s=arc-20160816; b=XjZucch/QdI377v1rFG9B4si9lXijAQjB7AzyTotOfrDPA8sSPQ2R49F/q4yNCGi7f xCM3Q4nNBeYlyhmshBxy7Eo/uWRbRlxj/y0d/cdyNFZd59Tx845JMqOUAD67g88rFtxk 57Kr3C34YeSbQwEgxbHbyzZobe1SdOF7Cpns+8lE0x8MCFkCsf6v/QjFWkgzcBnHAXI2 F2MtL8a0tm8b6ggJEzbxmmU7E/Yr4wcWnLTSge3hM0vdT261AfZ/7I+cwoxKtwgEoBPj RzBXNrVUOyryko/jmxgxn9rNUoA5ReuiYhTWIKl+EPY0XM0SHimEXVKV0m24LzHJB+Xm e7kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=k5G1la0Y9RGjju3d+5nDcSVkMAojGg0HRNbZ+c5hBxs=; b=depwi5/SJGddPRPyevdoknlDsjP8mQybxmqywyHpwsIcC74YiJXiztE5/itFyYgz6l 7mKnGhlGIzcb6q5rEgcSvZwHMdywsoN6VsqwMt99DnXQZ5sA2jrfGRwykI+64LHZsuXx QJTxuaSKLAuyA5dV/cqMe5aIcwyJ90QgmYsWGKuslU0v7i0G1NG+vYoxd52p2FG8Cbwv qemr9AN27mROwcAR9br5dgWuLMc/BgOe/Aj62QW4RMHcX8OJ6cKjvCj13/4DguMY8zle xfhilzM6EjFVoutEGt+spRDeaTpXEwGl27CfOH7Py2Z+1yUWq9YZlD8iWFEIU3H4p7wl eMfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e73-v6si13043047pfb.98.2018.10.15.23.22.23; Mon, 15 Oct 2018 23:22:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbeJPOJ0 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 16 Oct 2018 10:09:26 -0400 Received: from mga12.intel.com ([192.55.52.136]:49492 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbeJPOJ0 (ORCPT ); Tue, 16 Oct 2018 10:09:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 23:20:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,387,1534834800"; d="scan'208";a="81544531" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 15 Oct 2018 23:20:34 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Oct 2018 23:20:34 -0700 Received: from hasmsx108.ger.corp.intel.com (10.184.198.18) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Oct 2018 23:20:34 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.28]) by hasmsx108.ger.corp.intel.com ([169.254.9.136]) with mapi id 14.03.0319.002; Tue, 16 Oct 2018 09:20:29 +0300 From: "Winkler, Tomas" To: Jason Gunthorpe CC: Jarkko Sakkinen , Nayna Jain , "Usyskin, Alexander" , "Struk, Tadeusz" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Thread-Topic: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Thread-Index: AQHUZHjlTDh1wH1FgU+vrAhOzJfWh6UhKqiAgAA7gaA= Date: Tue, 16 Oct 2018 06:20:29 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9D9F2C7C@hasmsx109.ger.corp.intel.com> References: <20181015111434.7777-1-tomas.winkler@intel.com> <20181016054155.GA18664@ziepe.ca> In-Reply-To: <20181016054155.GA18664@ziepe.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDk2ZWMxZTYtY2YwMy00YWZmLThlNWQtYWFjZTgzNWE1Y2VjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUHlkQ2lSYjVcL29YMlZkQXFIeEhsSXNhenNpdXVqdUx5YmNmY045eHZRcjZKdlhqa0VORTUrZDg2UWhoQ2dVcFUifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.12.116.110] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > On Mon, Oct 15, 2018 at 02:14:34PM +0300, Tomas Winkler wrote: > > Ignore the return value of go_to_idle() in tpm_try_transmit(). > > Once it may shadow the return value of actual tpm operation, second > > the consequent command will fail as well and the error will be caought > > anyway. > > Last fix wrong goto, that jumped back instead of forward. > > > > Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from > > runtime_pm") > > Signed-off-by: Tomas Winkler > > drivers/char/tpm/tpm-interface.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/char/tpm/tpm-interface.c > > b/drivers/char/tpm/tpm-interface.c > > index 129f640424b7..f69c711bf74a 100644 > > +++ b/drivers/char/tpm/tpm-interface.c > > @@ -547,9 +547,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip > *chip, > > dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc); > > > > out: > > - rc = tpm_go_idle(chip, flags); > > - if (rc) > > - goto out; > > + (void)tpm_go_idle(chip, flags); > > We don't really use this style in the kernel, AFAIK. Right, there are no many of those; just wanted to emphasize that return value is ignored. I can drop (void). Thanks Tomas