[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0904090640170.13970@bicker>
Date: Thu, 9 Apr 2009 10:55:29 +0300 (EAT)
From: Dan Carpenter <error27@...il.com>
To: vbordug@...mvista.com, avorontsov@...mvista.com
cc: netdev@...r.kernel.org
Subject: [patch] error handling for platform_device_register_simple()
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@...il.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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists