From: Michael Ellerman <michael@ellerman.id.au>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH] Add null pointer check to of_find_property
Date: Thu, 08 May 2008 09:21:06 +1000 [thread overview]
Message-ID: <1210202466.16180.1.camel@localhost> (raw)
In-Reply-To: <1210187999-20274-1-git-send-email-timur@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
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 <timur@freescale.com>
> ---
>
> 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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-05-07 23:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 19:19 [PATCH] Add null pointer check to of_find_property Timur Tabi
2008-05-07 19:27 ` Grant Likely
2008-05-07 23:21 ` Michael Ellerman [this message]
2008-05-09 4:50 ` Paul Mackerras
2008-05-12 16:46 ` Timur Tabi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210202466.16180.1.camel@localhost \
--to=michael@ellerman.id.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=timur@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).