error handling for platform_device_register_simple()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
drivers/net/phy/fixed.c +2 -2
@@ -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; }