Skip to content

Commit 7d293f5

Browse files
AxelLinbroonie
authored andcommitted
regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer
A NULL init_data once incremented will lead to oops, fix it. Fixes: f979c08 ("regulator: tps6507x: Convert to regulator core's simplified DT parsing code") Reported-by: Sekhar Nori <[email protected]> Signed-off-by: Axel Lin <[email protected]> Tested-by: Sekhar Nori <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 4982094 commit 7d293f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/regulator/tps6507x-regulator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ static int tps6507x_pmic_probe(struct platform_device *pdev)
403403
/* common for all regulators */
404404
tps->mfd = tps6507x_dev;
405405

406-
for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
406+
for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++) {
407407
/* Register the regulators */
408408
tps->info[i] = info;
409-
if (init_data && init_data->driver_data) {
409+
if (init_data && init_data[i].driver_data) {
410410
struct tps6507x_reg_platform_data *data =
411-
init_data->driver_data;
411+
init_data[i].driver_data;
412412
info->defdcdc_default = data->defdcdc_default;
413413
}
414414

0 commit comments

Comments
 (0)