From: Zhaolei Date: Fri, 17 Oct 2008 11:12:30 +0000 (+0800) Subject: MIPS: Fix debugfs_create_*'s error checking method for arch/mips/math-emu/ X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ecab1f4479abb88d739bc1aac5545e8399fbad66;p=openwrt%2Fstaging%2Fblogic.git 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: Zhao Lei Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index b08fc65c13a6..7ec0b217dfd3 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c @@ -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; }