* [patch] pps: checking for NULL instead of IS_ERR()
@ 2012-02-08 9:25 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-02-08 9:25 UTC (permalink / raw)
To: Rodolfo Giometti; +Cc: linux-kernel, kernel-janitors
class_create() never returns NULLs only ERR_PTRs.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 2baadd2..98fbe62 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -369,9 +369,9 @@ static int __init pps_init(void)
int err;
pps_class = class_create(THIS_MODULE, "pps");
- if (!pps_class) {
+ if (IS_ERR(pps_class)) {
pr_err("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:[~2012-02-08 9:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 9:25 [patch] pps: checking for NULL instead of IS_ERR() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox