lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210330013659.916-1-linqiheng@huawei.com>
Date:   Tue, 30 Mar 2021 09:36:59 +0800
From:   Qiheng Lin <linqiheng@...wei.com>
To:     <linqiheng@...wei.com>, Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mihai Carabas <mihai.carabas@...cle.com>,
        "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
        zhenwei pi <pizhenwei@...edance.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Joe Perches <joe@...ches.com>,
        Shile Zhang <shile.zhang@...ux.alibaba.com>
CC:     <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        "Hulk Robot" <hulkci@...wei.com>
Subject: [PATCH -next] misc/pvpanic: fix return value check in pvpanic_pci_probe()

In case of error, the function pci_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Qiheng Lin <linqiheng@...wei.com>
---
 drivers/misc/pvpanic/pvpanic-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pvpanic/pvpanic-pci.c b/drivers/misc/pvpanic/pvpanic-pci.c
index f38a80a5bbc8..9ecc4e8559d5 100644
--- a/drivers/misc/pvpanic/pvpanic-pci.c
+++ b/drivers/misc/pvpanic/pvpanic-pci.c
@@ -83,8 +83,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	base = pci_iomap(pdev, 0, 0);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
+	if (!base)
+		return -ENOMEM;
 
 	pi = kmalloc(sizeof(*pi), GFP_ATOMIC);
 	if (!pi)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ