Skip to content

Commit

Permalink
sunhme: fix an IS_ERR() vs NULL check in probe
Browse files Browse the repository at this point in the history
The devm_request_region() function does not return error pointers, it
returns NULL on error.

Fixes: 914d9b2 ("sunhme: switch to devres")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Link: https://lore.kernel.org/r/Y0bWzJL8JknX8MUf@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jakub Kicinski committed Oct 13, 2022
1 parent 30e9672 commit 99df45c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/sun/sunhme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2896,8 +2896,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,

hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0), DRV_NAME);
if (IS_ERR(hpreg_res)) {
err = PTR_ERR(hpreg_res);
if (!hpreg_res) {
err = -EBUSY;
dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
goto err_out_clear_quattro;
}
Expand Down

0 comments on commit 99df45c

Please sign in to comment.