Skip to content

Commit

Permalink
mcb: request_mem_region() returns NULL on error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Apr 3, 2015
1 parent 127af88 commit d86fb45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mcb/mcb-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d86fb45

Please sign in to comment.