diff options
author | Jinjie Ruan <ruanjinjie@huawei.com> | 2023-08-31 20:39:27 +0800 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2024-09-20 10:50:38 -0400 |
commit | e229897d373a87ee09ec5cc4ecd4bb2f895fc16b (patch) | |
tree | bcc4f0eb7d72d44120de84ec998cf6e767e003cb /drivers/ntb/hw/intel/ntb_hw_gen1.c | |
parent | 98f7e32f20d28ec452afb208f9cffc08448a2652 (diff) | |
download | lwn-e229897d373a87ee09ec5cc4ecd4bb2f895fc16b.tar.gz lwn-e229897d373a87ee09ec5cc4ecd4bb2f895fc16b.zip |
ntb: intel: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers.
It never returns NULL. So use IS_ERR() to check it.
Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw/intel/ntb_hw_gen1.c')
-rw-r--r-- | drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c index 9ab836d0d4f1..079b8cd79785 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c @@ -778,7 +778,7 @@ static void ndev_init_debugfs(struct intel_ntb_dev *ndev) ndev->debugfs_dir = debugfs_create_dir(pci_name(ndev->ntb.pdev), debugfs_dir); - if (!ndev->debugfs_dir) + if (IS_ERR(ndev->debugfs_dir)) ndev->debugfs_info = NULL; else ndev->debugfs_info = |