Subject: Re: [PATCH] Add null pointer check to of_find_property

From: Michael Ellerman <[email-masked]>
Date: Thu, 08 May 2008 09:21:06 +1000

On Wed, 2008-05-07 at 14:19 -0500, Timur Tabi wrote:
> Update function of_find_property() to return NULL if the device_node passed
> to it is also NULL.  Otherwise, passing NULL will cause a null pointer
> dereference.
> 
> Signed-off-by: Timur Tabi <[email-masked]>
> ---
> 
> This patch allows callers to do this:

np = of_find_compatible_node(...);
prop = of_get_property(np);
if (!prop)
     goto error;

...

error:
 of_node_put(np)

:)

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person