diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-07-28 14:55:27 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-08-13 14:50:23 -0400 |
commit | 1ccd4b7bfdcfcc8cc7ffc4a9c11d3ac5b6da8ca0 (patch) | |
tree | 40b9a74eda985efb482dd1ebccd30f85f18dd6c2 | |
parent | 38ca285044be88a0fb47b6eb91deeeb729435fd0 (diff) |
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>
-rw-r--r-- | drivers/misc/cb710/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c index efec4139c3f6..68cd05b6d829 100644 --- a/drivers/misc/cb710/core.c +++ b/drivers/misc/cb710/core.c | |||
@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg); | |||
33 | static int __devinit cb710_pci_configure(struct pci_dev *pdev) | 33 | static int __devinit cb710_pci_configure(struct pci_dev *pdev) |
34 | { | 34 | { |
35 | unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); | 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 | u32 val; | 37 | u32 val; |
38 | 38 | ||
39 | cb710_pci_update_config_reg(pdev, 0x48, | 39 | cb710_pci_update_config_reg(pdev, 0x48, |
@@ -43,6 +43,7 @@ static int __devinit cb710_pci_configure(struct pci_dev *pdev) | |||
43 | if (val & 0x80000000) | 43 | if (val & 0x80000000) |
44 | return 0; | 44 | return 0; |
45 | 45 | ||
46 | pdev0 = pci_get_slot(pdev->bus, devfn); | ||
46 | if (!pdev0) | 47 | if (!pdev0) |
47 | return -ENODEV; | 48 | return -ENODEV; |
48 | 49 | ||