Skip to contentSkip to conversation

mcb: request_mem_region() returns NULL on error

PATCH New Dan Carpenter 1 participant 1 message Mar 26, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 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.

---
v2: same as before but rebased on top of latest linux-next

drivers/mcb/mcb-pci.c +2 -2
index 0af7361..de36237 100644
@@ -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;
 	}