avoid uninitialised variable use
authorjsg <jsg@openbsd.org>
Tue, 28 Aug 2018 09:35:35 +0000 (09:35 +0000)
committerjsg <jsg@openbsd.org>
Tue, 28 Aug 2018 09:35:35 +0000 (09:35 +0000)
ok patrick@ kettenis@

sys/dev/ofw/ofw_regulator.c

index cd916e8..9fc6133 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ofw_regulator.c,v 1.6 2018/08/13 15:14:27 patrick Exp $       */
+/*     $OpenBSD: ofw_regulator.c,v 1.7 2018/08/28 09:35:35 jsg Exp $   */
 /*
  * Copyright (c) 2016 Mark Kettenis
  *
@@ -218,6 +218,7 @@ regulator_gpio_get_voltage(int node)
        OF_getpropintarray(node, "gpios", gpios, glen);
        OF_getpropintarray(node, "states", states, slen);
 
+       i = 0;
        idx = 0;
        gpio = gpios;
        while (gpio && gpio < gpios + (glen / sizeof(uint32_t))) {