diff options
author | Qiheng Lin <linqiheng@huawei.com> | 2021-03-30 09:36:59 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-02 16:16:46 +0200 |
commit | 642fa28bb5ee2cf72e7d86b2fa9d06f2b04c9fb3 (patch) | |
tree | 027371c502d48cd7dc13beac1b44623f24a13780 /drivers/misc/pvpanic | |
parent | d72260cc7879c72c186900e7c153007a6137ed8e (diff) | |
download | linux-642fa28bb5ee2cf72e7d86b2fa9d06f2b04c9fb3.tar.gz linux-642fa28bb5ee2cf72e7d86b2fa9d06f2b04c9fb3.tar.bz2 linux-642fa28bb5ee2cf72e7d86b2fa9d06f2b04c9fb3.zip |
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@huawei.com>
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20210330013659.916-1-linqiheng@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/pvpanic')
-rw-r--r-- | drivers/misc/pvpanic/pvpanic-pci.c | 4 |
1 files 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) |