linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] wireless: ERR_PTR vs null
@ 2009-07-25 12:22 Dan Carpenter
  2009-07-25 12:46 ` Marcel Holtmann
  2009-07-27  1:26 ` Zhu Yi
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2009-07-25 12:22 UTC (permalink / raw)
  To: samuel.ortiz, yi.zhu; +Cc: linux-wireless

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-27  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).