Skip to content

Commit

Permalink
usb: gadget: ci13xxx_pci: guard against devices without driver_data
Browse files Browse the repository at this point in the history
Don't try to initialize devices that don't have driver_data assigned
to their pci ids.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alexander Shishkin authored and Greg Kroah-Hartman committed May 11, 2012
1 parent 6286d85 commit 1989b5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/usb/gadget/ci13xxx_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev,
struct resource res[3];
int retval = 0, nres = 2;

if (!driver) {
dev_err(&pdev->dev, "device doesn't provide driver data\n");
return -ENODEV;
}

retval = pci_enable_device(pdev);
if (retval)
goto done;
Expand Down

0 comments on commit 1989b5c

Please sign in to comment.