mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: langwell: Prevent possible NULL pointer dereference in the demux handler.
Date: Mon, 7 May 2012 21:18:55 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1205072117330.6271@ionos> (raw)
In-Reply-To: <1336321508-20981-1-git-send-email-krzysztof.wilczynski@linux.com>

On Sun, 6 May 2012, Krzysztof Wilczynski wrote:

> This is to address a possible NULL pointer dereference on a platform that might
> use this driver but its underlying IRQ chip does not provide an irq_eoi callback.
> 
> A commit 0766d20 added an conditional to the code, but then it was later
> super-seeded by commit 20e2aa9 which introduced number of helper functions
> for accessing various members of the irq_desc struct, but removed said
> conditional from the code.
> 
> This change will re-introduce conditional guarding against possible NULL
> pointer dereference caused by missing EIO handler.
> 
> Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
> ---
>  drivers/gpio/gpio-langwell.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
> index 00692e8..5749738 100644
> --- a/drivers/gpio/gpio-langwell.c
> +++ b/drivers/gpio/gpio-langwell.c
> @@ -260,7 +260,8 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
>  		}
>  	}
>  
> -	chip->irq_eoi(data);
> +	if (data)
> +		chip->irq_eoi(data);

And how does data, which is always set as long as the interrupt exist
prove that the chip has an eoi function?

Thanks,

	tglx

  reply	other threads:[~2012-05-07 19:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 16:25 Krzysztof Wilczynski
2012-05-07 19:18 ` Thomas Gleixner [this message]
2012-05-07 20:19   ` Krzysztof Wilczynski

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=alpine.LFD.2.02.1205072117330.6271@ionos \
    --to=tglx@linutronix.de \
    --cc=grant.likely@secretlab.ca \
    --cc=krzysztof.wilczynski@linux.com \
    --cc=linus.walleij@stericsson.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®