Skip to content

Commit

Permalink
MIPS: Fix debugfs_create_*'s error checking method for mips/kernel/
Browse files Browse the repository at this point in the history
debugfs_create_*() returns NULL on error.  Make its callers return -ENODEV
on error.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Zhaolei authored and Ralf Baechle committed Oct 27, 2008
1 parent ecab1f4 commit b517531
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ static int __init debugfs_mips(void)
struct dentry *d;

d = debugfs_create_dir("mips", NULL);
if (IS_ERR(d))
return PTR_ERR(d);
if (!d)
return -ENOMEM;
mips_debugfs_dir = d;
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ static int __init debugfs_unaligned(void)
return -ENODEV;
d = debugfs_create_u32("unaligned_instructions", S_IRUGO,
mips_debugfs_dir, &unaligned_instructions);
if (IS_ERR(d))
return PTR_ERR(d);
if (!d)
return -ENOMEM;
d = debugfs_create_u32("unaligned_action", S_IRUGO | S_IWUSR,
mips_debugfs_dir, &unaligned_action);
if (IS_ERR(d))
return PTR_ERR(d);
if (!d)
return -ENOMEM;
return 0;
}
__initcall(debugfs_unaligned);
Expand Down

0 comments on commit b517531

Please sign in to comment.