Commit 7ad12566 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

pps: class_create() returns an ERR_PTR, not NULL

class_create() never returns NULLs only ERR_PTRs.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6027ce49
...@@ -369,9 +369,9 @@ static int __init pps_init(void) ...@@ -369,9 +369,9 @@ static int __init pps_init(void)
int err; int err;
pps_class = class_create(THIS_MODULE, "pps"); pps_class = class_create(THIS_MODULE, "pps");
if (!pps_class) { if (IS_ERR(pps_class)) {
pr_err("failed to allocate class\n"); pr_err("failed to allocate class\n");
return -ENOMEM; return PTR_ERR(pps_class);
} }
pps_class->dev_attrs = pps_attrs; pps_class->dev_attrs = pps_attrs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment