mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: PPCML <linuxppc-dev@ozlabs.org>, Olof Johansson <olof@lixom.net>,
	Paul Mackerras <paulus@samba.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PPC: CHRP - fix possible NULL pointer dereference
Date: Fri, 23 Nov 2007 10:16:46 +1100	[thread overview]
Message-ID: <20071123101646.63550945.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20071122195423.GA9877@cvg>

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

On Thu, 22 Nov 2007 22:54:23 +0300 Cyrill Gorcunov <gorcunov@gmail.com> 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/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-11-22 23:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 19:54 Cyrill Gorcunov
2007-11-22 23:16 ` Stephen Rothwell [this message]
2007-11-23  4:23   ` Cyrill Gorcunov
2007-11-23  5:43   ` Cyrill Gorcunov

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=20071123101646.63550945.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /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

all inboxes | Powered by JetHome®