From: Dan Carpenter Date: Thu, 26 Mar 2015 19:12:49 +0000 (+0300) Subject: mcb: request_mem_region() returns NULL on error X-Git-Tag: firefly_0821_release~176^2~1906^2~25 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d86fb45b5c52d8f2a3e78e81afd85a2a9d4478d7;p=firefly-linux-kernel-4.4.55.git mcb: request_mem_region() returns NULL on error 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c index 0af7361e377f..de36237d7c6b 100644 --- a/drivers/mcb/mcb-pci.c +++ b/drivers/mcb/mcb-pci.c @@ -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; }