Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp579160ybz; Wed, 15 Apr 2020 14:26:34 -0700 (PDT) X-Google-Smtp-Source: APiQypKhgPRoidokl1gCR33hUXgUHxGxdhKmhpMc8ajlzVYRUZrDWBLCBBXUomdcdI7RL3oM1ydO X-Received: by 2002:a17:906:c281:: with SMTP id r1mr7002326ejz.310.1586985994281; Wed, 15 Apr 2020 14:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586985994; cv=none; d=google.com; s=arc-20160816; b=ex0aLZP80/CIUdhHoBNk8D3pW0BhfPt4WlxVQX7AoTazfu+nxRS4W7i2jkQgWpxzoe wpbKGmN9MFWf2ntX5VNoZhG2Q5osjNILkFfni6x5RYWvcJLCPG1hitEnCA59lbck0Xs0 xKl9QMu01SZ95RD6lQVqvImjzzMUowMPt/a/Xu6erze/94wy1pDK9hHz3w26pzu4k4UT +6gb/EoTqhur5c6kPRely0k1L0WDQ0LJ7LIiB5dtbNfT4YJkhBGTMqFaKDE4BBhXVzzT kYBc2Q36+cEjX8pUmRcTeLT2L/+jvhmv2b2yvneI7x16hYmM0YIR4DP0uYTUxBR+0oxq SnpA== 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=nXM5qSQUv90OHk19pQTdHSGqgGGD3XJ3zj5JqiRCg1Q=; b=e4qgUGXti5xABzVisKOgzJIC83cJff+/4l1V6YhfxJHelhHV8Ka05ybyOaHBTbutfn puYFkceLv3z0zGrS6vdcFkivEgzt/oao+B5qgcfICPC85/xbw25njhUuqZuzhUie/dzG pXHRUQ4IA0xw/LEjMWdX0nPSfJQLRY8LByRh0/z9o0R59EP/f1iVrw0bTnmL6tRClL8K gNtdmqwY/6sK4EL31MjjInL4fSUTHBUFMl4Tw/ZUhkDZPBrlh2k2S1Is2Icy+x9H42On hNntYARfJQqyCg8jl+Yd2v6lZdMe7veTMcpY5wBQC5LwbVK5MXd+VA4Ts56srZB70gFc BpjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si7332388ejd.3.2020.04.15.14.26.10; Wed, 15 Apr 2020 14:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439495AbgDNLml (ORCPT + 99 others); Tue, 14 Apr 2020 07:42:41 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:52198 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439489AbgDNLmi (ORCPT ); Tue, 14 Apr 2020 07:42:38 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04397;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0TvX5Wi8_1586864546; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0TvX5Wi8_1586864546) by smtp.aliyun-inc.com(127.0.0.1); Tue, 14 Apr 2020 19:42:27 +0800 From: Tianjia Zhang To: peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, jgg@ziepe.ca, arnd@arndb.de, gregkh@linuxfoundation.org, zhang.jia@linux.alibaba.com Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, tianjia.zhang@linux.alibaba.com Subject: [PATCH] tpm: fix wrong return value in tpm_pcr_extend Date: Tue, 14 Apr 2020 19:42:26 +0800 Message-Id: <20200414114226.96691-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the algorithm that does not match the bank, a positive value EINVAL is returned here. I think this is a typo error. It is necessary to return an error value. Signed-off-by: Tianjia Zhang --- 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 a438b1206fcb..1621ce818705 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -323,7 +323,7 @@ int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx, for (i = 0; i < chip->nr_allocated_banks; i++) { if (digests[i].alg_id != chip->allocated_banks[i].alg_id) { - rc = EINVAL; + rc = -EINVAL; goto out; } } -- 2.17.1