All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Scally <djrscally@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: intel_skl_int3472: Uninitialized variable in skl_int3472_handle_gpio_resources()
Date: Fri, 25 Jun 2021 14:46:59 +0100	[thread overview]
Message-ID: <540fe796-00d0-bef5-5b89-11f387aa8006@gmail.com> (raw)
In-Reply-To: <YNXTkLNtiTDlFlZa@mwanda>

Hi Dan, thanks for the patch

On 25/06/2021 14:01, Dan Carpenter wrote:
> This function returns negative error codes, zero (to indicate that
> everything has been completed successfully) and one (to indicate that
> more resources need to be handled still).
>
> This code prints an uninitialized error message when the function
> returns one which potentially leads to an Oops.


Ah! In the default case of the switch, took me a while to see that.
Thanks very much, good catch.


Reviewed-by: Daniel Scally <djrscally@gmail.com>

>
> Fixes: 5de691bffe57 ("platform/x86: Add intel_skl_int3472 driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  .../platform/x86/intel/int3472/intel_skl_int3472_discrete.c   | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/intel/int3472/intel_skl_int3472_discrete.c b/drivers/platform/x86/intel/int3472/intel_skl_int3472_discrete.c
> index 17c6fe830765..9fe0a2527e1c 100644
> --- a/drivers/platform/x86/intel/int3472/intel_skl_int3472_discrete.c
> +++ b/drivers/platform/x86/intel/int3472/intel_skl_int3472_discrete.c
> @@ -286,10 +286,10 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
>  	int3472->ngpios++;
>  	ACPI_FREE(obj);
>  
> -	if (ret)
> +	if (ret < 0)
>  		return dev_err_probe(int3472->dev, ret, err_msg);
>  
> -	return 0;
> +	return ret;
>  }
>  
>  static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)

  reply	other threads:[~2021-06-25 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 13:01 [PATCH] platform/x86: intel_skl_int3472: Uninitialized variable in skl_int3472_handle_gpio_resources() Dan Carpenter
2021-06-25 13:46 ` Daniel Scally [this message]
2021-06-28  9:10 ` Hans de Goede

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=540fe796-00d0-bef5-5b89-11f387aa8006@gmail.com \
    --to=djrscally@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.