Skip to contentSkip to conversation

nui.c error handling

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nui.c 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.

regards,
dan carpenter

drivers/net/niu.c +1 -1
@@ -8757,7 +8757,7 @@
 
 	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++) {