projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06fe577
)
mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
author
Marek Szyprowski
<
[email protected]
>
Thu, 23 Sep 2010 14:22:05 +0000
(16:22 +0200)
committer
Chris Ball
<
[email protected]
>
Sun, 26 Sep 2010 20:27:05 +0000
(16:27 -0400)
If not all clocks have been defined in platform data, the driver will
cause a null pointer dereference when it is removed. This patch fixes
this issue.
Signed-off-by: Marek Szyprowski <
[email protected]
>
Signed-off-by: Kyungmin Park <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Chris Ball <
[email protected]
>
drivers/mmc/host/sdhci-s3c.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/sdhci-s3c.c
b/drivers/mmc/host/sdhci-s3c.c
index 735d431f09e6f65ce901b7b2a1509f0b2c059bce..aacb862ecc8a979f8022b8e0dd3428ed26c15baa 100644
(file)
--- a/
drivers/mmc/host/sdhci-s3c.c
+++ b/
drivers/mmc/host/sdhci-s3c.c
@@
-483,8
+483,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);