Commit ecab1f44 authored by Zhaolei's avatar Zhaolei Committed by Ralf Baechle

MIPS: Fix debugfs_create_*'s error checking method for arch/mips/math-emu/

debugfs_create_*() returns NULL on error.  Make its caller debugfs_fpuemu
return -ENODEV on error.
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f8d56f17
......@@ -1299,12 +1299,12 @@ static int __init debugfs_fpuemu(void)
if (!mips_debugfs_dir)
return -ENODEV;
dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir);
if (IS_ERR(dir))
return PTR_ERR(dir);
if (!dir)
return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(vars); i++) {
d = debugfs_create_u32(vars[i].name, S_IRUGO, dir, vars[i].v);
if (IS_ERR(d))
return PTR_ERR(d);
if (!d)
return -ENOMEM;
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment