ntb: intel: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
[ Upstream commit e229897d373a87ee09ec5cc4ecd4bb2f895fc16b ]
The debugfs_create_dir() function returns error pointers.
It never returns NULL. So use IS_ERR() to check it.
Fixes: e26a5843f7 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4e1fe68d69
commit
4b2fbba4e4
1 changed files with 1 additions and 1 deletions
|
|
@ -775,7 +775,7 @@ static void ndev_init_debugfs(struct intel_ntb_dev *ndev)
|
||||||
ndev->debugfs_dir =
|
ndev->debugfs_dir =
|
||||||
debugfs_create_dir(pci_name(ndev->ntb.pdev),
|
debugfs_create_dir(pci_name(ndev->ntb.pdev),
|
||||||
debugfs_dir);
|
debugfs_dir);
|
||||||
if (!ndev->debugfs_dir)
|
if (IS_ERR(ndev->debugfs_dir))
|
||||||
ndev->debugfs_info = NULL;
|
ndev->debugfs_info = NULL;
|
||||||
else
|
else
|
||||||
ndev->debugfs_info =
|
ndev->debugfs_info =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue