Skip to content

Commit

Permalink
mmc: cb710: fix possible pci_dev leak in cb710_pci_configure()
Browse files Browse the repository at this point in the history
Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Michał Mirosław authored and Chris Ball committed Aug 13, 2011
1 parent 38ca285 commit 1ccd4b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/misc/cb710/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg);
static int __devinit cb710_pci_configure(struct pci_dev *pdev)
{
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;

cb710_pci_update_config_reg(pdev, 0x48,
Expand All @@ -43,6 +43,7 @@ static int __devinit cb710_pci_configure(struct pci_dev *pdev)
if (val & 0x80000000)
return 0;

pdev0 = pci_get_slot(pdev->bus, devfn);
if (!pdev0)
return -ENODEV;

Expand Down

0 comments on commit 1ccd4b7

Please sign in to comment.