Commit 642fa28b authored by Qiheng Lin's avatar Qiheng Lin Committed by Greg Kroah-Hartman

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarQiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20210330013659.916-1-linqiheng@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d72260cc
...@@ -83,8 +83,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev, ...@@ -83,8 +83,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev,
return ret; return ret;
base = pci_iomap(pdev, 0, 0); base = pci_iomap(pdev, 0, 0);
if (IS_ERR(base)) if (!base)
return PTR_ERR(base); return -ENOMEM;
pi = kmalloc(sizeof(*pi), GFP_ATOMIC); pi = kmalloc(sizeof(*pi), GFP_ATOMIC);
if (!pi) if (!pi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment