mmc: sdhci-s3c: fix wrong error-control
Subsystems (3)
Jaehoon Chung
maintainerPATCH 1/1 mmc: sdhci-s3c: fix wrong error-control
If sc->clk_bus[ptr] is NULL, happen NULL pointer error.
Signed-off-by Jaehoon Chung <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/mmc/host/sdhci-s3c.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-s3c.c +0 -0
@@ -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:
Signature · 1 line
1.7.4.1
Hi,
Quoted 25 lines · Jaehoon Chung
If sc->clk_bus[ptr] is NULL, happen NULL pointer error.
Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/mmc/host/sdhci-s3c.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-s3c.c +4
-2@@ -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]); + } }
Quoted 1 line
err_no_busclks:
Patch is corrupt due to line-wrapping.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child