Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6464524imu; Wed, 30 Jan 2019 15:26:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN540n8gE0NMlhjWxY423f6JzJXcEpLxdYHr6DpdKTUfm0LdKbLuL/UAXNBjji+mtbVx4mVQ X-Received: by 2002:a17:902:be11:: with SMTP id r17mr32605219pls.308.1548890813157; Wed, 30 Jan 2019 15:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548890813; cv=none; d=google.com; s=arc-20160816; b=hBYWjfc+whb7zrDWq9TBoXQtUYKEePiPfBgWYvChqXR5usTz8eAVtX93r9lEUfdhbp oJCSLipt16c+BSuuAHXifcReZgfIkZXWRYPczGYdigsp5zVq2oOK75piCTlKzASboFx8 3wSS5TMyjiD+sUw4x3xAVOEIIPcM244gQ02T3QhZ44CnzHdAhgy5GI68QJzgy1QEZSgF qAQVjNRnAAUxdbdH33FR4+tTz5m4gCkWJws1wSkd9JL8l614Az/eZfi6VZvdbxEXuJ1v 7yLXDkEZnkgAEpYLiU2SZ77WfrZJ0HQCKwmEO6lhjCf7d7EFAg+/CLIM6QyiDVxoDjM5 io4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WPJoPfZ8JVrlEvu4vK+6BVp+LsE9v4PG848Y9tYTt5Q=; b=qJl2JE/VJ5bpDYtIWeut4h0Kelc6XMzBVC3ZRS8U2bT9pnQP1qTPAezdaA4Pq+MdJq mq2/RF1Ls3RB2R82uuFJb0LoABj/njyCy4TTTNuyzlnKG8Czbhn8bU9YzbRlDAAwKKyE xcxb47rJgj1QO6THrqOSwHO1dd7T5AEPdA1Ek23oGG1g3MIeL+V2Au6VQphWNy9Y3dMZ iftzx2Twe8eTMudaauPBNcoa7/nGjRFCb283e1PvxhknF7CikmQOBxunFXzxzxGvug/r e2xEpXzvH+F2erPRR9cxqPfp/qKi96Qh7+eRPEIP/ZGbtynPCAkZm2dlFABNWlIDOquA jU4g== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10si2602944pgg.373.2019.01.30.15.26.37; Wed, 30 Jan 2019 15:26:53 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727919AbfA3X0c (ORCPT + 99 others); Wed, 30 Jan 2019 18:26:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbfA3X0c (ORCPT ); Wed, 30 Jan 2019 18:26:32 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC5169B309; Wed, 30 Jan 2019 22:07:00 +0000 (UTC) Received: from cantor.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6BB6608EB; Wed, 30 Jan 2019 22:07:00 +0000 (UTC) From: Jerry Snitselaar To: linux-integrity@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jarkko Sakkinen Subject: [PATCH 2/2] tpm: don't print error message in tpm_transmit_cmd when tpm still testing Date: Wed, 30 Jan 2019 15:06:59 -0700 Message-Id: <20190130220659.10102-2-jsnitsel@redhat.com> In-Reply-To: <20190130220659.10102-1-jsnitsel@redhat.com> References: <20190130220659.10102-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 30 Jan 2019 22:07:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently tpm_transmit_cmd will print an error message if the tpm returns something other than TPM2_RC_SUCCESS. This means that if the tpm returns that it is testing an error message will be printed, and this can cause confusion for the end user. So avoid printing the error message if TPM2_RC_TESTING is the return code. Reviewed-by: Jarkko Sakkinen Signed-off-by: Jerry Snitselaar --- drivers/char/tpm/tpm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index d9439f9abe78..6339a2e289ae 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -397,7 +397,7 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space, err = be32_to_cpu(header->return_code); if (err != 0 && err != TPM_ERR_DISABLED && err != TPM_ERR_DEACTIVATED - && desc) + && err != TPM2_RC_TESTING && desc) dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err, desc); if (err) -- 2.20.1.98.gecbdaf0899