From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbbJLHYc (ORCPT ); Mon, 12 Oct 2015 03:24:32 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:25041 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbbJLHYa (ORCPT ); Mon, 12 Oct 2015 03:24:30 -0400 X-IronPort-AV: E=Sophos;i="5.17,671,1437429600"; d="scan'208";a="182259911" Date: Mon, 12 Oct 2015 09:24:27 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Geert Uytterhoeven cc: Julia Lawall , Simon Horman , "kernel-janitors@vger.kernel.org" , Magnus Damm , Russell King , Linux-sh list , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Thomas Petazzoni , Andrew Lunn , Bjorn Helgaas , Jason Cooper Subject: Re: [PATCH 3/5] ARM: shmobile: R-Mobile: add missing of_node_put In-Reply-To: Message-ID: References: <1444480254-14399-1-git-send-email-Julia.Lawall@lip6.fr> <1444480254-14399-4-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) 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 Mon, 12 Oct 2015, Geert Uytterhoeven wrote: > Hi Julia, > > On Sat, Oct 10, 2015 at 2:30 PM, Julia Lawall wrote: > > --- a/arch/arm/mach-shmobile/pm-rmobile.c > > +++ b/arch/arm/mach-shmobile/pm-rmobile.c > > @@ -313,8 +313,10 @@ static int __init rmobile_add_pm_domains(void __iomem *base, > > } > > > > pd = kzalloc(sizeof(*pd), GFP_KERNEL); > > - if (!pd) > > + if (!pd) { > > + of_node_put(np); > > return -ENOMEM; > > + } > > While technically this patch is correct, the system will be dead anyway if it > ever goes OOM at core_initcall() time. Maybe it would be better for the code to be correct to serve as an example (or to avoid serving as a bad example) for others? julia