linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
@ 2010-09-23 14:22 Marek Szyprowski
  2010-09-23 19:08 ` Andrew Morton
  2010-09-23 19:12 ` Chris Ball
  0 siblings, 2 replies; 7+ messages in thread
From: Marek Szyprowski @ 2010-09-23 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

If not all clocks has been defined in platform data, driver will cause
a null pointer dereference when it is being removed. This patch fixes
this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/host/sdhci-s3c.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 71ad416..757d92c 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -481,8 +481,10 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
 	sdhci_remove_host(host, 1);
 
 	for (ptr = 0; ptr < 3; ptr++) {
-		clk_disable(sc->clk_bus[ptr]);
-		clk_put(sc->clk_bus[ptr]);
+		if (sc->clk_bus[ptr]) {
+			clk_disable(sc->clk_bus[ptr]);
+			clk_put(sc->clk_bus[ptr]);
+		}
 	}
 	clk_disable(sc->clk_io);
 	clk_put(sc->clk_io);
-- 
1.7.1.569.g6f426

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

end of thread, other threads:[~2010-09-27  6:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23 14:22 [PATCH] sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove Marek Szyprowski
2010-09-23 19:08 ` Andrew Morton
2010-09-25 22:53   ` Chris Ball
2010-09-26 10:53     ` Kyungmin Park
2010-09-26 15:25       ` Chris Ball
2010-09-27  6:09     ` Marek Szyprowski
2010-09-23 19:12 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).