mcb: request_mem_region() returns NULL on error
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Mar 2015 19:12:49 +0000 (22:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Apr 2015 14:15:30 +0000 (16:15 +0200)
The code here is checking for IS_ERR() when request_mem_region() only
returns NULL on error and never an ERR_PTR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mcb/mcb-pci.c

index 0af7361e377f61565258346f3f84a3933b9f15ba..de36237d7c6b45de10fca57cc1870fde5a0620e5 100644 (file)
@@ -56,9 +56,9 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        res = request_mem_region(priv->mapbase, CHAM_HEADER_SIZE,
                                 KBUILD_MODNAME);
-       if (IS_ERR(res)) {
+       if (!res) {
                dev_err(&pdev->dev, "Failed to request PCI memory\n");
-               ret = PTR_ERR(res);
+               ret = -EBUSY;
                goto out_disable;
        }