Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6444703imu; Wed, 30 Jan 2019 15:03:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN5QsF/5kuE9Wn1rG76yM8310HfiL0NGZpIJG2DstdIFaWf5n8KB+0VsM9JU5v/oPb//cUBK X-Received: by 2002:a17:902:d68c:: with SMTP id v12mr31958973ply.4.1548889399135; Wed, 30 Jan 2019 15:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548889399; cv=none; d=google.com; s=arc-20160816; b=kQ37H+V1O9U7N9fF/gAyYFYUNIxuB/twVJLz+6dSLZH8Njz/4LkNfRNOReRENr4+bH 4pjLDDFAVK4V4sPzgoxwQoETOZ4uaNZBdrFvfcMZBmmstgkMXkpnJlI23iryNX4gwJvk PTbJ8rt8IBIaJ55zhrT+7me0VzS2xh4t/sscJJ9I/htFdtrNhQhHYfjPFnJWgJM5DFkN N2okBZvaulfYPd25OXz33UZQ1Oo835G0LBBYLglDT2xyHTvnUL8kKHIQABnjeX3/Ar9w TlI1iyX4AReVmbe7V4YDlmqHDM3nmVxezzBWAkU2iVwHpQbaK5PVfRJDmps9RIw6Lb5e kNXw== 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=LSIv+gPthMEZB/D+m9v6Pa1852LPtwkUXcWrA/hkvK6zyZ6/yxiga+p/ZS2UZV7aJc SNFOo5FDWUtpEaPSA7U4eFea63ynpKVr7f7qsadQCE9W9wn478TAXA2dhhJ8NTrn2fLQ EJh9gOofdghs/vQr4NjZzgPgJUMmMcC1YsgzXNzTknAWI4mC0/eWuszsL4PjtxorOz7Q YvR56Ecfqh3vrueujSBv3tSa8n/LWbVGHKc4KQeWQKgQo4Ty9jA2NIOner4UlElbQlu9 keLYA1S/fO1GOvBgIb+1KfAHcXhs6uaV66KsrcI0Nvmh8SahvZE0OxPrp8T/H3Ix8gOi oM/A== 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 m9si2179066pfg.13.2019.01.30.15.03.03; Wed, 30 Jan 2019 15:03:19 -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 S1727740AbfA3XBq (ORCPT + 99 others); Wed, 30 Jan 2019 18:01:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37514 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfA3XBm (ORCPT ); Wed, 30 Jan 2019 18:01:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21655C002964; Wed, 30 Jan 2019 22:43:46 +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 D46935D717; Wed, 30 Jan 2019 22:43:45 +0000 (UTC) From: Jerry Snitselaar To: linux-integrity@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-security-module@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:43:33 -0700 Message-Id: <20190130224333.20373-2-jsnitsel@redhat.com> In-Reply-To: <20190130224333.20373-1-jsnitsel@redhat.com> References: <20190130224333.20373-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 30 Jan 2019 22:43:46 +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