Skip to content

Commit

Permalink
mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
Browse files Browse the repository at this point in the history
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 <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Marek Szyprowski authored and Chris Ball committed Sep 26, 2010
1 parent 06fe577 commit 9320f7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/sdhci-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9320f7c

Please sign in to comment.