From: Dan Carpenter Date: Mon, 5 Mar 2012 22:59:15 +0000 (-0800) Subject: pps: class_create() returns an ERR_PTR, not NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ad12566dc02ca76e0056af58606b5ce0181460f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git pps: class_create() returns an ERR_PTR, not NULL class_create() never returns NULLs only ERR_PTRs. Signed-off-by: Dan Carpenter Cc: Rodolfo Giometti Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c index 2baadd21b7a6..98fbe62694d4 100644 --- a/drivers/pps/pps.c +++ b/drivers/pps/pps.c @@ -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;