Commit 1ccd4b7bfdcfcc8cc7ffc4a9c11d3ac5b6da8ca0
Committed by
Chris Ball
1 parent
38ca285044
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
drivers/misc/cb710/core.c
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | static int __devinit cb710_pci_configure(struct pci_dev *pdev) |
34 | 34 | { |
35 | 35 | 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; | |
37 | 37 | u32 val; |
38 | 38 | |
39 | 39 | cb710_pci_update_config_reg(pdev, 0x48, |
... | ... | @@ -43,6 +43,7 @@ |
43 | 43 | if (val & 0x80000000) |
44 | 44 | return 0; |
45 | 45 | |
46 | + pdev0 = pci_get_slot(pdev->bus, devfn); | |
46 | 47 | if (!pdev0) |
47 | 48 | return -ENODEV; |
48 | 49 |