diff options
author | Wang Qing <wangqing@vivo.com> | 2020-11-06 17:43:31 +0800 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2020-12-06 18:14:44 -0500 |
commit | 91b8246de8590bac89b03b4fd14c61a8b4053b9e (patch) | |
tree | 453e1ec33408314decbf4bce2645c0446b4ea264 /drivers/ntb | |
parent | 3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff) | |
download | linux-91b8246de8590bac89b03b4fd14c61a8b4053b9e.tar.gz linux-91b8246de8590bac89b03b4fd14c61a8b4053b9e.tar.bz2 linux-91b8246de8590bac89b03b4fd14c61a8b4053b9e.zip |
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 <wangqing@vivo.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb')
-rw-r--r-- | drivers/ntb/hw/idt/ntb_hw_idt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c index d54261f50851..e7a4c2aa8baa 100644 --- a/drivers/ntb/hw/idt/ntb_hw_idt.c +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c @@ -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 (IS_ERR_OR_NULL(dbgfs_topdir)) { 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 */ @@ -2756,7 +2756,7 @@ static int idt_pci_probe(struct pci_dev *pdev, /* Allocate the memory for IDT NTB device data */ ndev = idt_create_dev(pdev, id); - if (IS_ERR_OR_NULL(ndev)) + if (IS_ERR(ndev)) return PTR_ERR(ndev); /* Initialize the basic PCI subsystem of the device */ |