From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755182AbdHYIpY (ORCPT ); Fri, 25 Aug 2017 04:45:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40092 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754931AbdHYIpW (ORCPT ); Fri, 25 Aug 2017 04:45:22 -0400 Date: Fri, 25 Aug 2017 10:45:15 +0200 (CEST) From: Thomas Gleixner To: Dan Carpenter cc: Marc Zyngier , David Daney , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] irqdomain: check for NULL before dereferencing In-Reply-To: <20170825071337.g72afdd5pdqjshon@mwanda> Message-ID: References: <20170825071337.g72afdd5pdqjshon@mwanda> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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, >