Skip to content

Commit

Permalink
pps: class_create() returns an ERR_PTR, not NULL
Browse files Browse the repository at this point in the history
class_create() never returns NULLs only ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Rodolfo Giometti <giometti@enneenne.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 6027ce4 commit 7ad1256
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pps/pps.c
Expand Up @@ -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;

Expand Down

0 comments on commit 7ad1256

Please sign in to comment.