diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2011-10-12 00:14:29 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 16:32:22 -0400 |
commit | 326adda53a50ece492c3edaa60afc26fba5e3232 (patch) | |
tree | 5ca2a03185d9e85a531585201c61fb2ede0100fe /drivers/mmc | |
parent | a3c76eb9d4a1e68a69dd880cf0bcb8a52418b993 (diff) |
mmc: sdhci-s3c: fix potential NULL dereference
sc->clk_bus[ptr] could be NULL.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | 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 82709b6da861..3d00e722efc9 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -567,8 +567,10 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
567 | 567 | ||
568 | err_req_regs: | 568 | err_req_regs: |
569 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { | 569 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { |
570 | clk_disable(sc->clk_bus[ptr]); | 570 | if (sc->clk_bus[ptr]) { |
571 | clk_put(sc->clk_bus[ptr]); | 571 | clk_disable(sc->clk_bus[ptr]); |
572 | clk_put(sc->clk_bus[ptr]); | ||
573 | } | ||
572 | } | 574 | } |
573 | 575 | ||
574 | err_no_busclks: | 576 | err_no_busclks: |