Skip to content

Commit 1ccd4b7

Browse files
osctobecjb
authored andcommitted
mmc: cb710: fix possible pci_dev leak in cb710_pci_configure()
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>
1 parent 38ca285 commit 1ccd4b7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/misc/cb710/core.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg);
3333
static int __devinit cb710_pci_configure(struct pci_dev *pdev)
3434
{
3535
unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0);
36-
struct pci_dev *pdev0 = pci_get_slot(pdev->bus, devfn);
36+
struct pci_dev *pdev0;
3737
u32 val;
3838

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

46+
pdev0 = pci_get_slot(pdev->bus, devfn);
4647
if (!pdev0)
4748
return -ENODEV;
4849

0 commit comments

Comments
 (0)