Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1135688pxb; Fri, 6 Nov 2020 01:45:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJylxxcoaJaqPqZTzZcUh6+SAo8XwmJRRm0kuWzvfZ6llCvrnCiWEziXr8EtmrOE6AUiBrxH X-Received: by 2002:a17:906:8282:: with SMTP id h2mr1293422ejx.50.1604655944874; Fri, 06 Nov 2020 01:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604655944; cv=none; d=google.com; s=arc-20160816; b=TQymp/wfG9pf1JIi37vqLlT8H3dRr2qvx1n9uyI3TLxI8MbILBy05VOg+41lAVpcim HV2/kzeeduFxeOhSdFJKSM1nBa0F1QNCuygun1Ms5a/S65QjWbdGWI2HfoE9Ic8XzCLG rTwc29e3gbryA0hcpxNivZYFSXEQi0jxFKyBLe0BNdrcpn6E5lNsEeVioHUlkINqzpfE LqWNkXhRaid4c/8M/o8jsBKbuT46oQKwMuv2liByINGsV2Romrwd1eqoG5CqVIe3GdD9 vZ+AuZPkPxCmAzWViP3ll07XeVjLFwhwjeoVznI9ufgKsKXyNKRWhtylvo78UT1IrNBJ TjFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=C7KU/8syNl/tDlwyJpqUvnw1GODJ6WQEc/aEieJe3+M=; b=WPQzcfQuWZWfF/+M0ty8Ngg/AoBT9bfhRWUq0QTG7Z1Ntag45MLYpKtXYDiKihftwb tiqD2GjXyk0TGNywxwo/2RyDuNZrTB01tMLU31+ArMmOpe97Xfl3vhi5C4y/oH6WxF0R cisG2c3G9U8sPhUNlNpuhQ8amT+JIOP8WKflyDoYDaeixhAcUI9jjlCPWZg8C77//OHE 5tnM3NbV/deoR9LaYn7IjzND5/lPHtyOYDXNui+JkQhNGLbxz5CG91Q7dBrczQ/z9iNR ao/22phNJUMuax0Kre9NH5JrJOCyvYsdytS8r+NKHDKZSeWhU9RLlmLByFSHXPy7h5Vw XNvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx25si491573ejb.270.2020.11.06.01.45.20; Fri, 06 Nov 2020 01:45:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726250AbgKFJnj (ORCPT + 99 others); Fri, 6 Nov 2020 04:43:39 -0500 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:5525 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgKFJnj (ORCPT ); Fri, 6 Nov 2020 04:43:39 -0500 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id D5413665B17; Fri, 6 Nov 2020 17:43:36 +0800 (CST) From: Wang Qing To: Serge Semin , Jon Mason , Dave Jiang , Allen Hubbe , linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] ntb: idt: fix error check in ntb_hw_idt.c Date: Fri, 6 Nov 2020 17:43:31 +0800 Message-Id: <1604655811-31933-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGR5NTBoYSh9KTh5CVkpNS09NTk5DSkxJT0hVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NyI6Hgw4Mj8jQhw4AxEvMw1K FhIaFCNVSlVKTUtPTU5OQ0pMTE9LVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFKQk9DNwY+ X-HM-Tid: 0a759cf0a1a49373kuwsd5413665b17 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org idt_create_dev never return NULL and fix smatch warning. Signed-off-by: Wang Qing --- drivers/ntb/hw/idt/ntb_hw_idt.c | 4 ++-- 1 file 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 d54261f..e7a4c2a --- 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 */ -- 2.7.4