Skip to contentSkip to conversation

sh: Fix boot crash related to SCI

PATCH New Rafael J. Wysocki 1 participant 1 message Aug 7, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: Fix boot crash related to SCI

From: Rafael J. Wysocki <[email protected]>

Commit d006199e72a9cf9537ff567ffa07c3f343b9182a (serial:
sh-sci: Regtype probing doesn't need to be fatal.) made sci_init_single() return when sci_probe_regmap() succeeds, although it should return when sci_probe_regmap() fails. This causes systems using the serial sh-sci driver to crash during boot.

Fix the problem by using the right return condition.

---
 drivers/tty/serial/sh-sci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sh-sci.c +1 -1
Index: linux-2.6/drivers/tty/serial/sh-sci.c
===================================================================
@@ -1889,7 +1889,7 @@ static int __devinit sci_init_single(str
 
 	if (p->regtype == SCIx_PROBE_REGTYPE) {
 		ret = sci_probe_regmap(p);
-		if (unlikely(!ret))
+		if (unlikely(ret))
 			return ret;
 	}