Commit 9b24001d authored by Zhaolei's avatar Zhaolei Committed by John W. Linville

Fix debugfs_create_bool's error checking method for wireless/iwlwifi/

debugfs_create_bool() returns NULL if an error occurs, returns -ENODEV
when debugfs is not enabled in the kernel.
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ac9440a4
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
#define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \ #define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \
dbgfs->dbgfs_##parent##_files.file_##name = \ dbgfs->dbgfs_##parent##_files.file_##name = \
debugfs_create_bool(#name, 0644, dbgfs->dir_##parent, ptr); \ 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; \ goto err; \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment