From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by ozlabs.org (Postfix) with ESMTP id 86C66DDDF9 for ; Fri, 23 Nov 2007 15:23:56 +1100 (EST) Received: by wa-out-1112.google.com with SMTP id m28so3692769wag for ; Thu, 22 Nov 2007 20:23:54 -0800 (PST) Message-ID: Date: Fri, 23 Nov 2007 07:23:54 +0300 From: "Cyrill Gorcunov" To: "Stephen Rothwell" Subject: Re: [PATCH] PPC: CHRP - fix possible NULL pointer dereference In-Reply-To: <20071123101646.63550945.sfr@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 References: <20071122195423.GA9877@cvg> <20071123101646.63550945.sfr@canb.auug.org.au> Cc: Olof Johansson , PPCML , Paul Mackerras , LKML List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 11/23/07, Stephen Rothwell wrote: > On Thu, 22 Nov 2007 22:54:23 +0300 Cyrill Gorcunov > wrote: > > > > This patch does fix possible NULL pointer dereference > > inside of strncmp() if of_get_property() failed. > > Thanks for this. > > > static void __init sio_init(void) > > { > > struct device_node *root; > > + const char *model = NULL; > > You don't need this initialization as you always assign the variable > before you use it. > > > + root = of_find_node_by_path("/"); > > + if (root) { > > if (!root) > return; > > would save a level of indentation. Not important. > > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ > Oh my :) Thanks. I'll fix it and resend.