aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/fixed.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-04-11 04:52:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-11 04:52:29 -0400
commit57401d5e36d2966247e9c06b94f5133609c8da21 (patch)
treebe9f5df2f4fe924303d897a16e7af3b9cd75c422 /drivers/net/phy/fixed.c
parent3384901f1b1af676ccb9d75aa23a568c294c527b (diff)
phy: 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. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/fixed.c')
-rw-r--r--drivers/net/phy/fixed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index cf24cc34debe..e7070515d2e3 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -19,6 +19,7 @@
19#include <linux/mii.h> 19#include <linux/mii.h>
20#include <linux/phy.h> 20#include <linux/phy.h>
21#include <linux/phy_fixed.h> 21#include <linux/phy_fixed.h>
22#include <linux/err.h>
22 23
23#define MII_REGS_NUM 29 24#define MII_REGS_NUM 29
24 25
@@ -207,8 +208,8 @@ static int __init fixed_mdio_bus_init(void)
207 int ret; 208 int ret;
208 209
209 pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); 210 pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
210 if (!pdev) { 211 if (IS_ERR(pdev)) {
211 ret = -ENOMEM; 212 ret = PTR_ERR(pdev);
212 goto err_pdev; 213 goto err_pdev;
213 } 214 }
214 215