* [patch v2] mcb: request_mem_region() returns NULL on error [not found] <1422946459-25517-2-git-send-email-johannes.thumshirn@men.de> @ 2015-03-26 19:12 ` Dan Carpenter 0 siblings, 0 replies; 2+ messages in thread From: Dan Carpenter @ 2015-03-26 19:12 UTC (permalink / raw) To: Johannes Thumshirn, gregkh; +Cc: linux-kernel, kernel-janitors 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> --- v2: same as before but rebased on top of latest linux-next diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c index 0af7361..de36237 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; } ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [patch v2] mcb: request_mem_region() returns NULL on error @ 2015-03-26 19:12 ` Dan Carpenter 0 siblings, 0 replies; 2+ messages in thread From: Dan Carpenter @ 2015-03-26 19:12 UTC (permalink / raw) To: Johannes Thumshirn, gregkh; +Cc: linux-kernel, kernel-janitors 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> --- v2: same as before but rebased on top of latest linux-next diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c index 0af7361..de36237 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; } ^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-26 19:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1422946459-25517-2-git-send-email-johannes.thumshirn@men.de>
2015-03-26 19:12 ` [patch v2] mcb: request_mem_region() returns NULL on error Dan Carpenter
2015-03-26 19:12 ` Dan Carpenter
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.