Message ID | 20230831141347.3166988-2-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() | expand |
diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c index 1dd9106c6513..d0438f9a9ab8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -1894,7 +1894,7 @@ 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,
Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use IS_ERR() to check it instead of checking NULL. Fixes: 4ea7da5fad43 ("iwlwifi: mei: add debugfs hooks") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> --- drivers/net/wireless/intel/iwlwifi/mei/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)