Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1231894imm; Wed, 17 Oct 2018 16:02:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV60iOEo024MXL6BHa7dy2wHUzKXoOCdk+ifSg3a1LS+pmutecU99E8DfLCubX8/8iH1N3COM X-Received: by 2002:a62:e091:: with SMTP id d17-v6mr27831094pfm.214.1539817340649; Wed, 17 Oct 2018 16:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539817340; cv=none; d=google.com; s=arc-20160816; b=yWKFo/vYO6fBetffSb37p8dt9kpMqjelo/SyV0FMGY2Act7R0x9hC6SUTZJMLDF+aG 4PUhDBaOzSZJjig2sQ2QVhqQyzRtogXCm52WS158tzXn66TgzrNqYckbuef0sqdLcdWY 9O2prckTMP6j3Y97/orBGc5fBYJHRHbMnvk5kGdpWyoeox5oMjkrFY1rR0tOEIydViby bmJXDmspr9KGPD0mKxwwpE8TOWBPTnkke7/SAu5StUI1qMDuru1rxYnJ02RkLUdb9Jvl VkUmjKlglRs5AdGraSDs902YXMC5+4A34+q/KQAgp1QSsKRumyzpyNi+8kjJFCebihEM FXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=BpRhE1Ev3b/Tov9HvamgnYrchT/bgt40bybsuXpUgRo=; b=zmjFikeQKa0AkKBddsbJFO/tzy2jknhWWfFOYXqLI/8RQIBZgVzCBMHx/d8hCaMkKZ El/zrEpi0dwyCRErJTudkBwi0/G4+xGH539xEOMMrb6hu6AxEcgKBmaCM1+7aGRLFNji byIL2XSkrXHFtIOpUnSEtsYcyP6eEHPlfzK2Hk7CDyLOBgzNuz4T59BNayt+sykCSOMU e1vJ5jnAUJWmiqHbBvJY+EWLnvZnme07NphtdmdIbJ+694JIvymf0boxjmzySSIcWvKt jFUPrfSwf+PJ2FrYgrVERsJ83zOKt2vCDAnCICxTob5BS2g4axq3XIDSv1hHKki+4wol pEng== 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 i21-v6si19460158pgj.51.2018.10.17.16.02.05; Wed, 17 Oct 2018 16:02:20 -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 S1727495AbeJRG7X (ORCPT + 99 others); Thu, 18 Oct 2018 02:59:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:53352 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbeJRG7X (ORCPT ); Thu, 18 Oct 2018 02:59:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 16:01:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,393,1534834800"; d="scan'208";a="98357807" Received: from unknown (HELO jsakkine-mobl1) ([10.249.254.40]) by fmsmga004.fm.intel.com with ESMTP; 17 Oct 2018 16:01:23 -0700 Date: Thu, 18 Oct 2018 02:01:22 +0300 (EEST) From: Jarkko Sakkinen X-X-Sender: jsakkine@jsakkine-mobl1 To: Tomas Winkler cc: Jarkko Sakkinen , Jason Gunthorpe , Nayna Jain , Alexander Usyskin , Tadeusz Struk , 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() In-Reply-To: <20181015111434.7777-1-tomas.winkler@intel.com> Message-ID: References: <20181015111434.7777-1-tomas.winkler@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Oct 2018, 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 > --- a/drivers/char/tpm/tpm-interface.c > +++ 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); > > if (need_locality) > tpm_relinquish_locality(chip, flags); > -- > 2.14.4 > > LGTM. Should be probably Cc'd to stable (can add). Reviewed-by: Jarkko Sakkinen /Jarkko