kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pps: class_create() returns an ERR_PTR
@ 2010-12-10 12:38 Dan Carpenter
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2010-12-10 12:38 UTC | newest]

Thread overview: (only message) (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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).