Skip to contentSkip to conversation

mmc: sdhci-s3c: fix wrong error-control

PATCH Superseded Jaehoon Chung 2 participants 2 messages Oct 11, 2011

Subsystems (3)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 1/1 mmc: sdhci-s3c: fix wrong error-control

If sc->clk_bus[ptr] is NULL, happen NULL pointer error.

---
 drivers/mmc/host/sdhci-s3c.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-s3c.c +0 -0
index 82709b6..3d00e72 100644
@@ -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
#1 lore raw

Hi,

Quoted 25 lines · Jaehoon Chung

If sc->clk_bus[ptr] is NULL, happen NULL pointer error.

---
 drivers/mmc/host/sdhci-s3c.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-s3c.c +4 -2
index 82709b6..3d00e72 100644
@@ -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