Skip to content

Commit 91b8246

Browse files
Wang Qingjonmason
authored andcommitted
ntb: idt: fix error check in ntb_hw_idt.c
idt_create_dev never return NULL and fix smatch warning. Signed-off-by: Wang Qing <[email protected]> Acked-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 3650b22 commit 91b8246

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ntb/hw/idt/ntb_hw_idt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,7 @@ static int idt_init_dbgfs(struct idt_ntb_dev *ndev)
25112511
/* If the top directory is not created then do nothing */
25122512
if (IS_ERR_OR_NULL(dbgfs_topdir)) {
25132513
dev_info(&ndev->ntb.pdev->dev, "Top DebugFS directory absent");
2514-
return PTR_ERR(dbgfs_topdir);
2514+
return PTR_ERR_OR_ZERO(dbgfs_topdir);
25152515
}
25162516

25172517
/* Create the info file node */
@@ -2756,7 +2756,7 @@ static int idt_pci_probe(struct pci_dev *pdev,
27562756

27572757
/* Allocate the memory for IDT NTB device data */
27582758
ndev = idt_create_dev(pdev, id);
2759-
if (IS_ERR_OR_NULL(ndev))
2759+
if (IS_ERR(ndev))
27602760
return PTR_ERR(ndev);
27612761

27622762
/* Initialize the basic PCI subsystem of the device */

0 commit comments

Comments
 (0)