Skip to contentSkip to conversation

pps: class_create() returns an ERR_PTR

PATCH New Dan Carpenter 1 participant 1 message Dec 10, 2010

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

PATCH 1/1 pps: class_create() returns an ERR_PTR

class_create() returns an ERR_PTR and it doesn't return NULL.

drivers/pps/pps.c +2 -2
index ca5183b..ef88108 100644
@@ -285,9 +285,9 @@ static int __init pps_init(void)
 	int err;
 
 	pps_class = class_create(THIS_MODULE, "pps");
-	if (!pps_class) {
+	if (IS_ERR(pps_class)) {
 		printk(KERN_ERR "pps: failed to allocate class\n");
-		return -ENOMEM;
+		return PTR_ERR(pps_class);
 	}
 	pps_class->dev_attrs = pps_attrs;