All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: xgene: clean up the unnecessary memory free
@ 2017-01-11  3:19 Shawn Lin
  2017-01-28 21:31 ` Bjorn Helgaas
  2017-02-10 17:38 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Shawn Lin @ 2017-01-11  3:19 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Shawn Lin

No need to free port as it is allocated by devm method.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/pci/host/pci-xgene.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index 7c3b54b..790b6cb 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -246,14 +246,11 @@ static int xgene_pcie_ecam_init(struct pci_config_window *cfg, u32 ipversion)
 	ret = xgene_get_csr_resource(adev, &csr);
 	if (ret) {
 		dev_err(dev, "can't get CSR resource\n");
-		kfree(port);
 		return ret;
 	}
 	port->csr_base = devm_ioremap_resource(dev, &csr);
-	if (IS_ERR(port->csr_base)) {
-		kfree(port);
+	if (IS_ERR(port->csr_base))
 		return -ENOMEM;
-	}
 
 	port->cfg_base = cfg->win;
 	port->version = ipversion;
-- 
1.9.1



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

* Re: [PATCH] PCI: xgene: clean up the unnecessary memory free
  2017-01-11  3:19 [PATCH] PCI: xgene: clean up the unnecessary memory free Shawn Lin
@ 2017-01-28 21:31 ` Bjorn Helgaas
  2017-02-10 17:38 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-01-28 21:31 UTC (permalink / raw)
  To: Shawn Lin; +Cc: Bjorn Helgaas, linux-pci, Tanmay Inamdar

[+cc Tanmay]

On Wed, Jan 11, 2017 at 11:19:15AM +0800, Shawn Lin wrote:
> No need to free port as it is allocated by devm method.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Please cc the maintainer so he knows to look at this.  I added Tanmay
for you, and I'll wait for his ack before applying this.

> ---
> 
>  drivers/pci/host/pci-xgene.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> index 7c3b54b..790b6cb 100644
> --- a/drivers/pci/host/pci-xgene.c
> +++ b/drivers/pci/host/pci-xgene.c
> @@ -246,14 +246,11 @@ static int xgene_pcie_ecam_init(struct pci_config_window *cfg, u32 ipversion)
>  	ret = xgene_get_csr_resource(adev, &csr);
>  	if (ret) {
>  		dev_err(dev, "can't get CSR resource\n");
> -		kfree(port);
>  		return ret;
>  	}
>  	port->csr_base = devm_ioremap_resource(dev, &csr);
> -	if (IS_ERR(port->csr_base)) {
> -		kfree(port);
> +	if (IS_ERR(port->csr_base))
>  		return -ENOMEM;
> -	}
>  
>  	port->cfg_base = cfg->win;
>  	port->version = ipversion;
> -- 
> 1.9.1
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] PCI: xgene: clean up the unnecessary memory free
  2017-01-11  3:19 [PATCH] PCI: xgene: clean up the unnecessary memory free Shawn Lin
  2017-01-28 21:31 ` Bjorn Helgaas
@ 2017-02-10 17:38 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-02-10 17:38 UTC (permalink / raw)
  To: Shawn Lin; +Cc: Bjorn Helgaas, linux-pci

On Wed, Jan 11, 2017 at 11:19:15AM +0800, Shawn Lin wrote:
> No need to free port as it is allocated by devm method.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Sorry, I didn't notice that this is almost identical to Dan
Carpenter's patch [1], which I had already applied.  You posted it
first, but Tanmay acked Dan's, so that's what I applied.  I added a
line to the changelog to at least give you some credit for it.

[1] https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-xgene&id=1ded56df3247d358390ae6dc09ccee620262ac5f

> ---
> 
>  drivers/pci/host/pci-xgene.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> index 7c3b54b..790b6cb 100644
> --- a/drivers/pci/host/pci-xgene.c
> +++ b/drivers/pci/host/pci-xgene.c
> @@ -246,14 +246,11 @@ static int xgene_pcie_ecam_init(struct pci_config_window *cfg, u32 ipversion)
>  	ret = xgene_get_csr_resource(adev, &csr);
>  	if (ret) {
>  		dev_err(dev, "can't get CSR resource\n");
> -		kfree(port);
>  		return ret;
>  	}
>  	port->csr_base = devm_ioremap_resource(dev, &csr);
> -	if (IS_ERR(port->csr_base)) {
> -		kfree(port);
> +	if (IS_ERR(port->csr_base))
>  		return -ENOMEM;
> -	}
>  
>  	port->cfg_base = cfg->win;
>  	port->version = ipversion;
> -- 
> 1.9.1
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-02-10 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11  3:19 [PATCH] PCI: xgene: clean up the unnecessary memory free Shawn Lin
2017-01-28 21:31 ` Bjorn Helgaas
2017-02-10 17:38 ` Bjorn Helgaas

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.