]>
Commit | Line | Data |
---|---|---|
8fbdb368 GKH |
1 | From 9320f7cbbdd5febf013b0e91db29189724057738 Mon Sep 17 00:00:00 2001 |
2 | From: Marek Szyprowski <m.szyprowski@samsung.com> | |
3 | Date: Thu, 23 Sep 2010 16:22:05 +0200 | |
4 | Subject: mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove | |
5 | ||
6 | From: Marek Szyprowski <m.szyprowski@samsung.com> | |
7 | ||
8 | commit 9320f7cbbdd5febf013b0e91db29189724057738 upstream. | |
9 | ||
10 | If not all clocks have been defined in platform data, the driver will | |
11 | cause a null pointer dereference when it is removed. This patch fixes | |
12 | this issue. | |
13 | ||
14 | Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> | |
15 | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> | |
16 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
17 | Signed-off-by: Chris Ball <cjb@laptop.org> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
19 | ||
20 | --- | |
21 | drivers/mmc/host/sdhci-s3c.c | 6 ++++-- | |
22 | 1 file changed, 4 insertions(+), 2 deletions(-) | |
23 | ||
24 | --- a/drivers/mmc/host/sdhci-s3c.c | |
25 | +++ b/drivers/mmc/host/sdhci-s3c.c | |
26 | @@ -372,8 +372,10 @@ static int __devexit sdhci_s3c_remove(st | |
27 | sdhci_remove_host(host, 1); | |
28 | ||
29 | for (ptr = 0; ptr < 3; ptr++) { | |
30 | - clk_disable(sc->clk_bus[ptr]); | |
31 | - clk_put(sc->clk_bus[ptr]); | |
32 | + if (sc->clk_bus[ptr]) { | |
33 | + clk_disable(sc->clk_bus[ptr]); | |
34 | + clk_put(sc->clk_bus[ptr]); | |
35 | + } | |
36 | } | |
37 | clk_disable(sc->clk_io); | |
38 | clk_put(sc->clk_io); |