public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: samuel.ortiz@intel.com, yi.zhu@intel.com
Cc: linux-wireless@vger.kernel.org
Subject: [patch] wireless: ERR_PTR vs null
Date: Sat, 25 Jul 2009 15:22:59 +0300 (EAT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0907241000250.11771@bicker> (raw)

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>

--- 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;

             reply	other threads:[~2009-07-25 12:23 UTC|newest]

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

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=alpine.DEB.2.00.0907241000250.11771@bicker \
    --to=error27@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=samuel.ortiz@intel.com \
    --cc=yi.zhu@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