Skip to contentSkip to conversation

mmc: sdhci-s3c: fix wrong error-control

PATCH RESEND In review Jaehoon Chung 2 participants 2 messages Oct 12, 2011

Subsystems (3)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH RESEND 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 +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]);
+		}
 	}
 
  err_no_busclks:
Signature · 1 line
1.7.4.1
#1 lore raw

Hi,

Quoted 15 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 +0 -0
index 82709b6..3d00e72 100644
@@ -567,8 +567,10 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
  err_req_regs:

drivers/mmc/host/sdhci-s3c.c static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · line 576

Quoted 10 lines
drivers/mmc/host/sdhci-s3c.c +4 -2
 	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:

Thanks, pushed to mmc-next for 3.2.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child