All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sonny Rao <sonnyrao@us.ibm.com>
To: Jani Nikula <ext-jani.1.nikula@nokia.com>
Cc: linux-kernel@vger.kernel.org, benh@kernel.crashing.org,
	tklauser@distanz.ch, jkosina@suse.cz
Subject: Re: [PATCH] powerpc/BSR: fix device_create() return value check
Date: Thu, 11 Mar 2010 15:21:57 -0600	[thread overview]
Message-ID: <20100311212157.GD5204@us.ibm.com> (raw)
In-Reply-To: <1268324153-30345-1-git-send-email-ext-jani.1.nikula@nokia.com>

On Thu, Mar 11, 2010 at 06:15:53PM +0200, Jani Nikula wrote:
> From: Jani Nikula <ext-jani.1.nikula@nokia.com>
> 
> Use IS_ERR() instead of comparing to NULL.
> 
> Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
> 
> ---
> 
> NOTE: I'm afraid I'm unable to test this; please consider this more a
> bug report than a complete patch.
> ---
>  drivers/char/bsr.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
> index c02db01..3b31f74 100644
> --- a/drivers/char/bsr.c
> +++ b/drivers/char/bsr.c
> @@ -252,7 +252,7 @@ static int bsr_add_node(struct device_node *bn)
> 
>  		cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev,
>  						cur, cur->bsr_name);
> -		if (!cur->bsr_device) {
> +		if (IS_ERR(cur->bsr_device)) {
>  			printk(KERN_ERR "device_create failed for %s\n",
>  			       cur->bsr_name);
>  			cdev_del(&cur->bsr_cdev);
> -- 
> 1.6.5.2
> 

This looks fine to me, good catch.

Acked-by: Sonny Rao <sonnyrao@us.ibm.com>


  reply	other threads:[~2010-03-11 21:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 16:15 [PATCH] powerpc/BSR: fix device_create() return value check Jani Nikula
2010-03-11 21:21 ` Sonny Rao [this message]
2010-03-15 14:24   ` Jiri Kosina

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=20100311212157.GD5204@us.ibm.com \
    --to=sonnyrao@us.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=ext-jani.1.nikula@nokia.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.