提交 7ad12566 编写于 作者: D Dan Carpenter 提交者: Linus Torvalds

pps: class_create() returns an ERR_PTR, not NULL

class_create() never returns NULLs only ERR_PTRs.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6027ce49
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册