Commit 1989b5ce authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

usb: gadget: ci13xxx_pci: guard against devices without driver_data

Don't try to initialize devices that don't have driver_data assigned
to their pci ids.
Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6286d85e
...@@ -51,6 +51,11 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, ...@@ -51,6 +51,11 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev,
struct resource res[3]; struct resource res[3];
int retval = 0, nres = 2; 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); retval = pci_enable_device(pdev);
if (retval) if (retval)
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment