All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	Andy Shevchenko <andy@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] pinctrl: intel: fix NULL pointer deref
Date: Wed, 9 Jun 2021 13:12:10 +0300	[thread overview]
Message-ID: <YMCT+izizEg0gPLD@lahna.fi.intel.com> (raw)
In-Reply-To: <20210609062722.9132-1-henning.schild@siemens.com>

Hi,

On Wed, Jun 09, 2021 at 08:27:22AM +0200, Henning Schild wrote:
> match could be NULL in which case we do not go ACPI after all
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  drivers/pinctrl/intel/pinctrl-intel.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> index 85750974d182..dca17bb76cac 100644
> --- a/drivers/pinctrl/intel/pinctrl-intel.c
> +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> @@ -1601,12 +1601,12 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
>  	const struct intel_pinctrl_soc_data *data = NULL;
>  	const struct intel_pinctrl_soc_data **table;
>  	struct acpi_device *adev;
> +	const void *match;
>  	unsigned int i;
>  
>  	adev = ACPI_COMPANION(&pdev->dev);
> -	if (adev) {
> -		const void *match = device_get_match_data(&pdev->dev);
> -
> +	match = device_get_match_data(&pdev->dev);

Actually we don't even call intel_pinctrl_get_soc_data() if the ACPI ID
is not listed in the corresponding driver's module table. So I don't
think match can ever be NULL.

But feel free to prove me wrong ;-)

  reply	other threads:[~2021-06-09 10:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  6:27 [PATCH] pinctrl: intel: fix NULL pointer deref Henning Schild
2021-06-09 10:12 ` Mika Westerberg [this message]
2021-06-09 10:33   ` Andy Shevchenko
2021-06-09 11:08     ` Henning Schild
2021-06-10 14:25       ` Andy Shevchenko
2021-06-10 14:32         ` Andy Shevchenko
2021-06-10 14:56           ` Henning Schild
2021-06-10 15:00             ` Andy Shevchenko
2021-06-10 15:28               ` Andy Shevchenko
2021-06-11 18:19                 ` Henning Schild

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=YMCT+izizEg0gPLD@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=henning.schild@siemens.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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.