Skip to content

Commit

Permalink
mmc: sdhci-s3c: fix potential NULL dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaehoon Chung authored and Chris Ball committed Oct 26, 2011
1 parent a3c76eb commit 326adda
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 @@ -567,8 +567,10 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)

err_req_regs:
for (ptr = 0; ptr < MAX_BUS_CLK; 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]);
}
}

err_no_busclks:
Expand Down

0 comments on commit 326adda

Please sign in to comment.