diff options
author | Pan Bian <bianpan2016@163.com> | 2019-04-17 17:41:23 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-04-25 19:56:56 +0300 |
commit | 8149069db81853570a665f5e5648c0e526dc0e43 (patch) | |
tree | d5c4f4398cc94e0b3bc6641211c6a3f42d8331a8 /drivers/net/wireless/intersil | |
parent | 84242b82d81c54e009a2aaa74d3d9eff70babf56 (diff) | |
download | linux-8149069db81853570a665f5e5648c0e526dc0e43.tar.bz2 |
p54: drop device reference count if fails to enable device
The function p54p_probe takes an extra reference count of the PCI
device. However, the extra reference count is not dropped when it fails
to enable the PCI device. This patch fixes the bug.
Cc: stable@vger.kernel.org
Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/intersil')
-rw-r--r-- | drivers/net/wireless/intersil/p54/p54pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/intersil/p54/p54pci.c b/drivers/net/wireless/intersil/p54/p54pci.c index 27a49068d32d..57ad56435dda 100644 --- a/drivers/net/wireless/intersil/p54/p54pci.c +++ b/drivers/net/wireless/intersil/p54/p54pci.c @@ -554,7 +554,7 @@ static int p54p_probe(struct pci_dev *pdev, err = pci_enable_device(pdev); if (err) { dev_err(&pdev->dev, "Cannot enable new PCI device\n"); - return err; + goto err_put; } mem_addr = pci_resource_start(pdev, 0); @@ -639,6 +639,7 @@ static int p54p_probe(struct pci_dev *pdev, pci_release_regions(pdev); err_disable_dev: pci_disable_device(pdev); +err_put: pci_dev_put(pdev); return err; } |