Skip to content

Commit

Permalink
MIPS: Fix debugfs_create_*'s error checking method for arch/mips/math…
Browse files Browse the repository at this point in the history
…-emu/

debugfs_create_*() returns NULL on error.  Make its caller debugfs_fpuemu
return -ENODEV on error.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Zhaolei authored and Ralf Baechle committed Oct 27, 2008
1 parent f8d56f1 commit ecab1f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/mips/math-emu/cp1emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ecab1f4

Please sign in to comment.