public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] error handling for platform_device_register_simple()
@ 2009-04-09  7:55 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2009-04-09  7:55 UTC (permalink / raw)
  To: vbordug, avorontsov; +Cc: netdev

platform_device_register_simple() returns ERR_PTR() and not NULL.

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/phy/fixed.c	2009-04-09 05:53:24.000000000 +0300
+++ devel/drivers/net/phy/fixed.c	2009-04-09 05:53:52.000000000 +0300
@@ -207,8 +207,8 @@
 	int ret;
 
 	pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
-	if (!pdev) {
-		ret = -ENOMEM;
+	if (IS_ERR(pdev)) {
+		ret = PTR_ERR(pdev);
 		goto err_pdev;
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-09  7:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-09  7:55 [patch] error handling for platform_device_register_simple() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox