]> Git Repo - linux.git/commitdiff
sunhme: fix an IS_ERR() vs NULL check in probe
authorDan Carpenter <[email protected]>
Wed, 12 Oct 2022 15:01:32 +0000 (18:01 +0300)
committerJakub Kicinski <[email protected]>
Thu, 13 Oct 2022 16:34:09 +0000 (09:34 -0700)
The devm_request_region() function does not return error pointers, it
returns NULL on error.

Fixes: 914d9b2711dd ("sunhme: switch to devres")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Sean Anderson <[email protected]>
Reviewed-by: Rolf Eike Beer <[email protected]>
Link: https://lore.kernel.org/r/Y0bWzJL8JknX8MUf@kili
Signed-off-by: Jakub Kicinski <[email protected]>
drivers/net/ethernet/sun/sunhme.c

index 62deed210a957047eac205689f9be1e63e79589a..91f10f746dffdf446586adc35a0c23413c2561ea 100644 (file)
@@ -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;
        }
This page took 0.064962 seconds and 4 git commands to generate.