All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pps: class_create() returns an ERR_PTR
@ 2010-12-10 12:38 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-12-10 12:38 UTC (permalink / raw)
  To: Rodolfo Giometti; +Cc: linux-kernel, kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index ca5183b..ef88108 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [patch] pps: class_create() returns an ERR_PTR
@ 2010-12-10 12:38 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-12-10 12:38 UTC (permalink / raw)
  To: Rodolfo Giometti; +Cc: linux-kernel, kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index ca5183b..ef88108 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-10 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10 12:38 [patch] pps: class_create() returns an ERR_PTR Dan Carpenter
2010-12-10 12:38 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.