linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Jiang Liu <jiang.liu@linux.intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-integrity@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tpm/ppi: fix return type in tpm_show_ppi_response()
Date: Sat, 6 Aug 2022 21:11:33 +0300	[thread overview]
Message-ID: <Yu6u1RZb7uZ6rMA6@kernel.org> (raw)
In-Reply-To: <YutwPjef/hseEE31@kili>

On Thu, Aug 04, 2022 at 10:07:42AM +0300, Dan Carpenter wrote:
> This "status" is declared as type acpi_status but it is never used to
> store any acpi_statuses, only int.
> 
> The tpm_show_ppi_response() function returns ssize_t (signed long) and
> acpi_status is unsigned int.  That means that negative error codes will
> be type promoted to large positive values.
> 
> Fixes: 84b1667dea23 ("ACPI / TPM: replace open-coded _DSM code with helper functions")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/char/tpm/tpm_ppi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
> index 40018a73b3cb..240df925c38c 100644
> --- a/drivers/char/tpm/tpm_ppi.c
> +++ b/drivers/char/tpm/tpm_ppi.c
> @@ -222,7 +222,7 @@ static ssize_t tpm_show_ppi_response(struct device *dev,
>  				     struct device_attribute *attr,
>  				     char *buf)
>  {
> -	acpi_status status = -EINVAL;
> +	int status = -EINVAL;
>  	union acpi_object *obj, *ret_obj;
>  	u64 req, res;
>  	struct tpm_chip *chip = to_tpm_chip(dev);
> -- 
> 2.35.1
> 


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

      reply	other threads:[~2022-08-06 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  7:07 [PATCH] tpm/ppi: fix return type in tpm_show_ppi_response() Dan Carpenter
2022-08-06 18:11 ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yu6u1RZb7uZ6rMA6@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=jiang.liu@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=rafael.j.wysocki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).