Skip to content

Commit 22ea71d

Browse files
Dan Carpentertorvalds
authored andcommitted
c2port: class_create() returns an ERR_PTR
class_create() doesn't return a NULL, it only returns ERR_PTRs. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7ad1256 commit 22ea71d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/c2port/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,9 @@ static int __init c2port_init(void)
984984
" - (C) 2007 Rodolfo Giometti\n");
985985

986986
c2port_class = class_create(THIS_MODULE, "c2port");
987-
if (!c2port_class) {
987+
if (IS_ERR(c2port_class)) {
988988
printk(KERN_ERR "c2port: failed to allocate class\n");
989-
return -ENOMEM;
989+
return PTR_ERR(c2port_class);
990990
}
991991
c2port_class->dev_attrs = c2port_attrs;
992992

0 commit comments

Comments
 (0)