From 58f3e0a864c46dadbeadf682e6bbdcab14ba19d3 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 8 Apr 2009 15:44:04 -0700 Subject: [PATCH] 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 Signed-off-by: David S. Miller --- drivers/net/niu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, plat_dev = platform_device_register_simple("niu", niu_parent_index, NULL, 0); - if (!plat_dev) + if (IS_ERR(plat_dev)) return NULL; for (i = 0; attr_name(niu_parent_attributes[i]); i++) { -- 2.20.1