Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3788883imm; Mon, 15 Oct 2018 04:19:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV609/rDdM+0c9y9YUJZj1+Pto+2KvuJjNATwhpX14yv1/TQqjkm6yNbJeZ8uIgffOiF9Qvij X-Received: by 2002:a63:4281:: with SMTP id p123-v6mr15286074pga.91.1539602363290; Mon, 15 Oct 2018 04:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539602363; cv=none; d=google.com; s=arc-20160816; b=Oal4Pqq5QswaGBhAdRIw5nVjlR9VoRlRQnKBz8/jHOhD548eIcHUMjS+MemMtHVzdT ZT9uto+76CymGuJI3cujT62MAhDaAfiHQQIsJ+6bmrlPOfy64yc8ndI7dPbueSjJX920 3YPyd1eA4nXwppbRaopwGRxnfgZvXxT7QIZM7XbfK+eL0Yxj2Gv6vwUKQ+7xsg7AH554 iTAyheaNJI1QMTkCrKsmUJPoTlBnVP3rQDfyE9WQbEO0vFi8UqLs3ZRFOAPGgZZ1ZgCq 9+iAIKg6nB5CcLNl+B2M62PrEQqigsj7i2oEsf9PBHenY2f5WhLO3HLo7vkjhPTa64XA tlWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=qXEkSqsqFA1air2NRToOLIuZ9fpQh5MM1+vCXtUNwPU=; b=oaxMmmNRVTTeUTmZXbuobTCXZjvaJkFj/OzfLHJHNoIG4a58wYKME6BAkoc1d0zPWp /+JMH+0U7Y+uo9g59NSbZT8yJVDEOYTCCcg+HmlwNRMe+urUiw+5r1Y4Dxv546UoWhyM pht4FlX0h/TfxF8pImgX1C1HuGM/GuLB4LbWLiQ84wNH21gQHlDeWE/pjwE+92bzkg3k gucQcHz8i9Dv/BTDZVBz2S0T8cTUz4/8BMujKBoP3bNsSsC9LrYmJTfZVLSsc5bkDs/I 73F7YuNBIQKXjmyF/kYlETE+0E/D1hQzeYxYzC8J+7jb5woPk1tfcYKBKw5KUFOZq5ck +N8w== 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 u69-v6si9461795pgd.353.2018.10.15.04.19.08; Mon, 15 Oct 2018 04:19:23 -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 S1726591AbeJOTD1 (ORCPT + 99 others); Mon, 15 Oct 2018 15:03:27 -0400 Received: from mga18.intel.com ([134.134.136.126]:15518 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbeJOTD1 (ORCPT ); Mon, 15 Oct 2018 15:03:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 04:18:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,384,1534834800"; d="scan'208";a="92070327" Received: from twinkler-lnx.jer.intel.com ([10.12.91.48]) by orsmga003.jf.intel.com with ESMTP; 15 Oct 2018 04:18:35 -0700 From: Tomas Winkler To: Jarkko Sakkinen , Jason Gunthorpe Cc: Nayna Jain , Alexander Usyskin , Tadeusz Struk , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Tomas Winkler Subject: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Date: Mon, 15 Oct 2018 14:14:34 +0300 Message-Id: <20181015111434.7777-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.14.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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