[-next] spi: dw-pci: remove free for resources allocated with devm_*
diff mbox

Message ID CAPgLHd9tVkshm+T-emPowGZT6_tNZHnBSMvhLeeQw3Ti-SytvA@mail.gmail.com
State Accepted
Commit 136c8bf374dd9aef0f98e5c26d1cba5b066e2443
Headers show

Commit Message

Wei Yongjun Jan. 7, 2014, 1:36 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

It's not necessary to free resources allocated with devm_*
and free them may lead to double free.

Fixes: 04f421e7b0b1 ('spi: dw: use managed resources')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/spi/spi-dw-pci.c | 4 ----
 1 file changed, 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Mark Brown Jan. 7, 2014, 3:47 p.m. UTC | #1
On Tue, Jan 07, 2014 at 09:36:24PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> It's not necessary to free resources allocated with devm_*
> and free them may lead to double free.

Applied, thanks.

Patch
diff mbox

diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
index a98f64d..3f3dc12 100644
--- a/drivers/spi/spi-dw-pci.c
+++ b/drivers/spi/spi-dw-pci.c
@@ -91,10 +91,6 @@  static void spi_pci_remove(struct pci_dev *pdev)
 	struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
 
 	dw_spi_remove_host(&dwpci->dws);
-	iounmap(dwpci->dws.regs);
-	pci_release_region(pdev, 0);
-	kfree(dwpci);
-	pci_disable_device(pdev);
 }
 
 #ifdef CONFIG_PM