Fix the incorrect return value check for debugfs_create_dir(), which returns ERR_PTR(-ERROR) instead of NULL when it fails. Fixes: 4ea7da5fad43 ("iwlwifi: mei: add debugfs hooks") Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx> --- drivers/net/wireless/intel/iwlwifi/mei/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c index dce0b7cf7b265c6..17a08ecd11b3202 100644 --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -1921,8 +1921,7 @@ static const struct file_operations iwl_mei_dbgfs_req_ownership_ops = { static void iwl_mei_dbgfs_register(struct iwl_mei *mei) { mei->dbgfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); - - if (!mei->dbgfs_dir) + if (IS_ERR(mei->dbgfs_dir)) return; debugfs_create_ulong("status", S_IRUSR, -- 2.34.1