aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-04-08 18:44:04 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-08 18:44:04 -0400
commit58f3e0a864c46dadbeadf682e6bbdcab14ba19d3 (patch)
tree7630276b8177b034e1cb79f58be73dbb3199527e /drivers/net
parentb5e86db4c7f6397ef86ab5e4a3fbece966935577 (diff)
niu: Fix error handling
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/niu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 73cac6c78cb6..2cd6109b8586 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -9542,7 +9542,7 @@ static struct niu_parent * __devinit niu_new_parent(struct niu *np,
9542 9542
9543 plat_dev = platform_device_register_simple("niu", niu_parent_index, 9543 plat_dev = platform_device_register_simple("niu", niu_parent_index,
9544 NULL, 0); 9544 NULL, 0);
9545 if (!plat_dev) 9545 if (IS_ERR(plat_dev))
9546 return NULL; 9546 return NULL;
9547 9547
9548 for (i = 0; attr_name(niu_parent_attributes[i]); i++) { 9548 for (i = 0; attr_name(niu_parent_attributes[i]); i++) {