Skip to content

Commit 7ad1256

Browse files
Dan Carpentertorvalds
authored andcommitted
pps: class_create() returns an ERR_PTR, not NULL
class_create() never returns NULLs only ERR_PTRs. Signed-off-by: Dan Carpenter <[email protected]> Cc: Rodolfo Giometti <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6027ce4 commit 7ad1256

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pps/pps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ static int __init pps_init(void)
369369
int err;
370370

371371
pps_class = class_create(THIS_MODULE, "pps");
372-
if (!pps_class) {
372+
if (IS_ERR(pps_class)) {
373373
pr_err("failed to allocate class\n");
374-
return -ENOMEM;
374+
return PTR_ERR(pps_class);
375375
}
376376
pps_class->dev_attrs = pps_attrs;
377377

0 commit comments

Comments
 (0)