Re: [PATCH -tip] irq: check chip->ack before calling (WAS: irq:remove unneeded desc->chip->ack check)
From: Ingo Molnar
Date: Mon Dec 29 2008 - 06:23:51 EST
* Wang Chen <wangchen@xxxxxxxxxxxxxx> wrote:
> Ingo Molnar said the following on 2008-12-26 21:27:
> > * Wang Chen <wangchen@xxxxxxxxxxxxxx> wrote:
> >
> >> desc->chip->ack is initialized to ack_bad().
> >> It will not be NULL.
> >
> > hm, that is only true of no_irq_chip() - is it true of all irq_chip
> > definitions on all architectures?
> >
>
> No, some arch's irq_chip doesn't have ack routine.
> So I was wrong.
> But this enlighten another thought that generic irq layer doesn't know
> whether irq_chip has ack routine on some architectures.
> Upon that, before calling chip->ack, should check it's not NULL.
>
> Impact: fix theoretic NULL dereference
>
> Signed-off-by: Wang Chen <wangchen@xxxxxxxxxxxxxx>
applied to tip/irq/genirq, thanks!
(find below how the final commit message ended up looking like.)
Ingo
------------------>