Commit 91b8246d authored by Wang Qing's avatar Wang Qing Committed by Jon Mason

ntb: idt: fix error check in ntb_hw_idt.c

idt_create_dev never return NULL and fix smatch warning.
Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
Acked-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 3650b228
...@@ -2511,7 +2511,7 @@ static int idt_init_dbgfs(struct idt_ntb_dev *ndev) ...@@ -2511,7 +2511,7 @@ static int idt_init_dbgfs(struct idt_ntb_dev *ndev)
/* If the top directory is not created then do nothing */ /* If the top directory is not created then do nothing */
if (IS_ERR_OR_NULL(dbgfs_topdir)) { if (IS_ERR_OR_NULL(dbgfs_topdir)) {
dev_info(&ndev->ntb.pdev->dev, "Top DebugFS directory absent"); dev_info(&ndev->ntb.pdev->dev, "Top DebugFS directory absent");
return PTR_ERR(dbgfs_topdir); return PTR_ERR_OR_ZERO(dbgfs_topdir);
} }
/* Create the info file node */ /* Create the info file node */
...@@ -2756,7 +2756,7 @@ static int idt_pci_probe(struct pci_dev *pdev, ...@@ -2756,7 +2756,7 @@ static int idt_pci_probe(struct pci_dev *pdev,
/* Allocate the memory for IDT NTB device data */ /* Allocate the memory for IDT NTB device data */
ndev = idt_create_dev(pdev, id); ndev = idt_create_dev(pdev, id);
if (IS_ERR_OR_NULL(ndev)) if (IS_ERR(ndev))
return PTR_ERR(ndev); return PTR_ERR(ndev);
/* Initialize the basic PCI subsystem of the device */ /* Initialize the basic PCI subsystem of the device */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment