netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] nui.c error handling
@ 2009-04-08 11:39 Dan Carpenter
  2009-04-08 22:44 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-04-08 11:39 UTC (permalink / raw)
  To: netdev

platform_device_register_simple() returns ERR_PTR(), not NULL, if an error 
occurs.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/drivers/net/niu.c	2009-04-07 21:59:22.000000000 +0300
+++ devel/drivers/net/niu.c	2009-04-07 22:00:45.000000000 +0300
@@ -8757,7 +8757,7 @@
 
 	plat_dev = platform_device_register_simple("niu", niu_parent_index,
 						   NULL, 0);
-	if (!plat_dev)
+	if (IS_ERR(plat_dev))
 		return NULL;
 
 	for (i = 0; attr_name(niu_parent_attributes[i]); i++) {

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

* Re: [patch] nui.c error handling
  2009-04-08 11:39 [patch] nui.c error handling Dan Carpenter
@ 2009-04-08 22:44 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-04-08 22:44 UTC (permalink / raw)
  To: error27; +Cc: netdev

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 8 Apr 2009 14:39:28 +0300 (EAT)

> platform_device_register_simple() returns ERR_PTR(), not NULL, if an error 
> occurs.
> 
> Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied, thanks.

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

end of thread, other threads:[~2009-04-08 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 11:39 [patch] nui.c error handling Dan Carpenter
2009-04-08 22:44 ` David Miller

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).