Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 326adda5 authored by Jaehoon Chung's avatar Jaehoon Chung Committed by Chris Ball
Browse files

mmc: sdhci-s3c: fix potential NULL dereference



sc->clk_bus[ptr] could be NULL.

Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent a3c76eb9
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -567,9 +567,11 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)


 err_req_regs:
 err_req_regs:
	for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
	for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
		if (sc->clk_bus[ptr]) {
			clk_disable(sc->clk_bus[ptr]);
			clk_disable(sc->clk_bus[ptr]);
			clk_put(sc->clk_bus[ptr]);
			clk_put(sc->clk_bus[ptr]);
		}
		}
	}


 err_no_busclks:
 err_no_busclks:
	clk_disable(sc->clk_io);
	clk_disable(sc->clk_io);