Skip to content

Commit

Permalink
drivers/misc/phantom.c: add missing warning messages in phantom_probe()
Browse files Browse the repository at this point in the history
phantom_probe() can fail in many places.  Add missing warning messages in
pci_enable_device() and pci_request_regions().

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rahul Ruikar authored and Linus Torvalds committed Oct 26, 2010
1 parent ca1cab3 commit 10ad527
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/misc/phantom.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
int retval;

retval = pci_enable_device(pdev);
if (retval)
if (retval) {
dev_err(&pdev->dev, "pci_enable_device failed!\n");
goto err;
}

minor = phantom_get_free();
if (minor == PHANTOM_MAX_MINORS) {
Expand All @@ -356,8 +358,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
phantom_devices[minor] = 1;

retval = pci_request_regions(pdev, "phantom");
if (retval)
if (retval) {
dev_err(&pdev->dev, "pci_request_regions failed!\n");
goto err_null;
}

retval = -ENOMEM;
pht = kzalloc(sizeof(*pht), GFP_KERNEL);
Expand Down

0 comments on commit 10ad527

Please sign in to comment.