Skip to contentSkip to conversation

regulator: 88pm800: forever loop in pm800_regulator_probe()

PATCH Applied Dan Carpenter 3 participants 3 messages Aug 14, 2013

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

PATCH 1/1 regulator: 88pm800: forever loop in pm800_regulator_probe()

This is supposed to be testing "i < ARRAY_SIZE()" instead of just "ARRAY_SIZE()".

drivers/regulator/88pm800.c +1 -1
index 58e9b74..3459f60 100644
@@ -302,7 +302,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		unsigned int count = 0;
 
 		/* Check whether num_regulator is valid. */
-		for (i = 0; ARRAY_SIZE(pdata->regulators); i++) {
+		for (i = 0; i < ARRAY_SIZE(pdata->regulators); i++) {
 			if (pdata->regulators[i])
 				count++;
 		}
Reviewed-by on v1 1/1
#1 lore raw

2013/8/15 Dan Carpenter <[email protected]>:

Quoted 10 lines

This is supposed to be testing "i < ARRAY_SIZE()" instead of just "ARRAY_SIZE()".

drivers/regulator/88pm800.c +0 -0
index 58e9b74..3459f60 100644

drivers/regulator/88pm800.c static int pm800_regulator_probe(struct platform_device *pdev) · line 308

Quoted 8 lines
drivers/regulator/88pm800.c +1 -1
@@ -302,7 +302,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
                unsigned int count = 0;
 
                /* Check whether num_regulator is valid. */
-               for (i = 0; ARRAY_SIZE(pdata->regulators); i++) {
+               for (i = 0; i < ARRAY_SIZE(pdata->regulators); i++) {
                        if (pdata->regulators[i])
                                count++;
                }

Oops. My bad. Thanks for the fix.

maintainer Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 2 lines · Dan Carpenter

This is supposed to be testing "i < ARRAY_SIZE()" instead of just "ARRAY_SIZE()".

Applied, thanks.