Commit 22ea71d7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

c2port: class_create() returns an ERR_PTR

class_create() doesn't return a NULL, it only returns ERR_PTRs.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7ad12566
...@@ -984,9 +984,9 @@ static int __init c2port_init(void) ...@@ -984,9 +984,9 @@ static int __init c2port_init(void)
" - (C) 2007 Rodolfo Giometti\n"); " - (C) 2007 Rodolfo Giometti\n");
c2port_class = class_create(THIS_MODULE, "c2port"); c2port_class = class_create(THIS_MODULE, "c2port");
if (!c2port_class) { if (IS_ERR(c2port_class)) {
printk(KERN_ERR "c2port: failed to allocate class\n"); printk(KERN_ERR "c2port: failed to allocate class\n");
return -ENOMEM; return PTR_ERR(c2port_class);
} }
c2port_class->dev_attrs = c2port_attrs; c2port_class->dev_attrs = c2port_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