Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jinjie Ruan and committed by
Jon Mason
e229897d 98f7e32f

+1 -1
+1 -1
drivers/ntb/hw/intel/ntb_hw_gen1.c
··· 778 778 ndev->debugfs_dir = 779 779 debugfs_create_dir(pci_name(ndev->ntb.pdev), 780 780 debugfs_dir); 781 - if (!ndev->debugfs_dir) 781 + if (IS_ERR(ndev->debugfs_dir)) 782 782 ndev->debugfs_info = NULL; 783 783 else 784 784 ndev->debugfs_info =