Re: [PATCH 09/12] Fix possible NULL pointer dereference in print_IO_APIC

From: Jeremy Fitzhardinge
Date: Tue May 18 2010 - 14:16:13 EST


On 05/18/2010 03:23 AM, Stefano Stabellini wrote:
> Make sure chip_data is not NULL before accessing it.
>

You should clarify under what circumstances it can be legitimately NULL.

J

> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> ---
> arch/x86/kernel/apic/io_apic.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index eb2789c..c64499c 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -1732,6 +1732,8 @@ __apicdebuginit(void) print_IO_APIC(void)
> struct irq_pin_list *entry;
>
> cfg = desc->chip_data;
> + if (!cfg)
> + continue;
> entry = cfg->irq_2_pin;
> if (!entry)
> continue;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/