Commit 1ccd4b7b authored by Michał Mirosław's avatar Michał Mirosław Committed by Chris Ball

mmc: cb710: fix possible pci_dev leak in cb710_pci_configure()

Reported-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 38ca2850
...@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg); ...@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg);
static int __devinit cb710_pci_configure(struct pci_dev *pdev) static int __devinit cb710_pci_configure(struct pci_dev *pdev)
{ {
unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0);
struct pci_dev *pdev0 = pci_get_slot(pdev->bus, devfn); struct pci_dev *pdev0;
u32 val; u32 val;
cb710_pci_update_config_reg(pdev, 0x48, cb710_pci_update_config_reg(pdev, 0x48,
...@@ -43,6 +43,7 @@ static int __devinit cb710_pci_configure(struct pci_dev *pdev) ...@@ -43,6 +43,7 @@ static int __devinit cb710_pci_configure(struct pci_dev *pdev)
if (val & 0x80000000) if (val & 0x80000000)
return 0; return 0;
pdev0 = pci_get_slot(pdev->bus, devfn);
if (!pdev0) if (!pdev0)
return -ENODEV; return -ENODEV;
......
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