Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719835

Re: [PATCH] irqdomain: check for NULL before dereferencing

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] irqdomain: check for NULL before dereferencing
Date 2017-08-25 10:50 +0200
Message-ID <uiitr-1L5-17@gated-at.bofh.it> (permalink)
References <uih4m-11w-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 25 Aug 2017, Dan Carpenter wrote:

> I reversed these two checks so we check "root_irq_data" for NULL before
> dereferencing it.

Can you please start to write coherent changelogs? See
Documentation/process/submitting-patches.rst

The above describes the change you made which is completely pointless
because we can see the change in the patch.

What's missing is WHY this is required and WHAT the problem with the
existing code is.

Thanks,

	tglx

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> index b9c688944429..e84b7056bb08 100644
> --- a/kernel/irq/irqdomain.c
> +++ b/kernel/irq/irqdomain.c
> @@ -1505,10 +1505,10 @@ int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg)
>  	if (WARN_ON(!irq_domain_is_hierarchy(domain)))
>  		return -EINVAL;
>  
> -	if (domain->parent != root_irq_data->domain)
> +	if (!root_irq_data)
>  		return -EINVAL;
>  
> -	if (!root_irq_data)
> +	if (domain->parent != root_irq_data->domain)
>  		return -EINVAL;
>  
>  	child_irq_data = kzalloc_node(sizeof(*child_irq_data), GFP_KERNEL,
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] irqdomain: check for NULL before dereferencing Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-25 09:20 +0200
  Re: [PATCH] irqdomain: check for NULL before dereferencing Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 10:50 +0200
    [PATCH v2] irqdomain: potential Oops in irq_domain_push_irq() Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-25 11:20 +0200
      Re: [PATCH v2] irqdomain: potential Oops in irq_domain_push_irq() Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200

csiph-web