linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "Ortiz, Samuel" <samuel.ortiz@intel.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [patch] wireless: ERR_PTR vs null
Date: Mon, 27 Jul 2009 09:26:59 +0800	[thread overview]
Message-ID: <1248658019.3747.94.camel@debian> (raw)
In-Reply-To: <alpine.DEB.2.00.0907241000250.11771@bicker>

On Sat, 2009-07-25 at 20:22 +0800, Dan Carpenter wrote:
> iwm_wdev_alloc() returns an ERR_PTR on failure and not null.  It also 
> prints its own dev_err() message so I removed that as well.
> 
> Compile tested only.  Sorry.  
> Found by smatch (http://repo.or.cz/w/smatch.git).
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Zhu Yi <yi.zhu@intel.com>

Thanks,
-yi

> --- orig/drivers/net/wireless/iwmc3200wifi/netdev.c	2009-07-24 09:56:49.000000000 +0300
> +++ devel/drivers/net/wireless/iwmc3200wifi/netdev.c	2009-07-24 09:57:31.000000000 +0300
> @@ -106,10 +106,8 @@
>  	int ret = 0;
>  
>  	wdev = iwm_wdev_alloc(sizeof_bus, dev);
> -	if (!wdev) {
> -		dev_err(dev, "no memory for wireless device instance\n");
> -		return ERR_PTR(-ENOMEM);
> -	}
> +	if (IS_ERR(wdev))
> +		return wdev;
>  
>  	iwm = wdev_to_iwm(wdev);
>  	iwm->bus_ops = if_ops;


      parent reply	other threads:[~2009-07-27  1:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-25 12:22 [patch] wireless: ERR_PTR vs null Dan Carpenter
2009-07-25 12:46 ` Marcel Holtmann
2009-07-27  1:26 ` Zhu Yi [this message]

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=1248658019.3747.94.camel@debian \
    --to=yi.zhu@intel.com \
    --cc=error27@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=samuel.ortiz@intel.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).