提交 ecab1f44 编写于 作者: Z Zhaolei 提交者: 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: NZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 f8d56f17
...@@ -1299,12 +1299,12 @@ static int __init debugfs_fpuemu(void) ...@@ -1299,12 +1299,12 @@ static int __init debugfs_fpuemu(void)
if (!mips_debugfs_dir) if (!mips_debugfs_dir)
return -ENODEV; return -ENODEV;
dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir); dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir);
if (IS_ERR(dir)) if (!dir)
return PTR_ERR(dir); return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(vars); i++) { for (i = 0; i < ARRAY_SIZE(vars); i++) {
d = debugfs_create_u32(vars[i].name, S_IRUGO, dir, vars[i].v); d = debugfs_create_u32(vars[i].name, S_IRUGO, dir, vars[i].v);
if (IS_ERR(d)) if (!d)
return PTR_ERR(d); return -ENOMEM;
} }
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册