Fix debugfs_create_bool's error checking method for wireless/iwlwifi/
authorZhaolei <zhaolei@cn.fujitsu.com>
Wed, 22 Oct 2008 09:06:12 +0000 (17:06 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 31 Oct 2008 23:00:44 +0000 (19:00 -0400)
debugfs_create_bool() returns NULL if an error occurs, returns -ENODEV
when debugfs is not enabled in the kernel.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-debugfs.c

index 753f9387aa68154a00b4b526b130cc190ac13578..c3df5aa8df919350459bc6ad9d172ae3a76628a3 100644 (file)
@@ -58,7 +58,8 @@
 #define DEBUGFS_ADD_BOOL(name, parent, ptr) do {                        \
        dbgfs->dbgfs_##parent##_files.file_##name =                     \
        debugfs_create_bool(#name, 0644, dbgfs->dir_##parent, ptr);     \
-       if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name))          \
+       if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name)           \
+                       || !dbgfs->dbgfs_##parent##_files.file_##name)  \
                goto err;                                               \
 } while (0)