Skip to content

Commit

Permalink
c2port: class_create() returns an ERR_PTR
Browse files Browse the repository at this point in the history
class_create() doesn't return a NULL, it only returns ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Carpenter authored and torvalds committed Mar 5, 2012
1 parent 7ad1256 commit 22ea71d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/c2port/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,9 +984,9 @@ static int __init c2port_init(void)
" - (C) 2007 Rodolfo Giometti\n");

c2port_class = class_create(THIS_MODULE, "c2port");
if (!c2port_class) {
if (IS_ERR(c2port_class)) {
printk(KERN_ERR "c2port: failed to allocate class\n");
return -ENOMEM;
return PTR_ERR(c2port_class);
}
c2port_class->dev_attrs = c2port_attrs;

Expand Down

0 comments on commit 22ea71d

Please sign in to comment.