All of lore.kernel.org
 help / color / mirror / Atom feed
* p54: drop device reference count if fails to enable device
@ 2019-04-17  9:41 Pan Bian
  2019-04-19 17:56 ` Christian Lamparter
  2019-04-25 16:57 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Pan Bian @ 2019-04-17  9:41 UTC (permalink / raw)
  To: Christian Lamparter, Kalle Valo, David S. Miller
  Cc: linux-wireless, netdev, linux-kernel, Pan Bian

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.

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/net/wireless/intersil/p54/p54pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intersil/p54/p54pci.c b/drivers/net/wireless/intersil/p54/p54pci.c
index 27a4906..57ad564 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;
 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: p54: drop device reference count if fails to enable device
  2019-04-17  9:41 p54: drop device reference count if fails to enable device Pan Bian
@ 2019-04-19 17:56 ` Christian Lamparter
  2019-04-25 16:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Lamparter @ 2019-04-19 17:56 UTC (permalink / raw)
  To: Pan Bian
  Cc: Christian Lamparter, Kalle Valo, David S. Miller, linux-wireless,
	netdev, linux-kernel

Subject should include a "[PATCH]" as per:
https://www.kernel.org/doc/html/v4.15/process/submitting-patches.html#include-patch-in-the-subject

Nevertheless, patchwork picked it up.... so, you are probably fine.

https://patchwork.kernel.org/patch/10905039/

On Wednesday, April 17, 2019 11:41:23 AM CEST Pan Bian wrote:
> 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.
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>
Cc: stable@vger.kernel.org 
Acked-by: Christian Lamparter <chunkeey@gmail.com>

> ---
>  drivers/net/wireless/intersil/p54/p54pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intersil/p54/p54pci.c b/drivers/net/wireless/intersil/p54/p54pci.c
> index 27a4906..57ad564 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;
>  }
> 





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: p54: drop device reference count if fails to enable device
  2019-04-17  9:41 p54: drop device reference count if fails to enable device Pan Bian
  2019-04-19 17:56 ` Christian Lamparter
@ 2019-04-25 16:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-04-25 16:57 UTC (permalink / raw)
  To: Pan Bian
  Cc: Christian Lamparter, David S. Miller, linux-wireless, netdev,
	linux-kernel, Pan Bian

Pan Bian <bianpan2016@163.com> wrote:

> 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>

Patch applied to wireless-drivers-next.git, thanks.

8149069db818 p54: drop device reference count if fails to enable device

-- 
https://patchwork.kernel.org/patch/10905039/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-25 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17  9:41 p54: drop device reference count if fails to enable device Pan Bian
2019-04-19 17:56 ` Christian Lamparter
2019-04-25 16:57 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.