diff --git a/[refs] b/[refs] index 3b20ff9d2011..bd62003bccce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9bb09111a4f5dbf8a0bd7df77ec79d3fdf9e5d2 +refs/heads/master: eb758de6a00f2c1f5694efc503b94d162db99734 diff --git a/trunk/drivers/regulator/lp8788-buck.c b/trunk/drivers/regulator/lp8788-buck.c index 11619493a5cb..ef845c7ac69f 100644 --- a/trunk/drivers/regulator/lp8788-buck.c +++ b/trunk/drivers/regulator/lp8788-buck.c @@ -474,7 +474,7 @@ static int lp8788_init_dvs(struct platform_device *pdev, u8 default_dvs_mode[] = { LP8788_BUCK1_DVS_I2C, LP8788_BUCK2_DVS_I2C }; /* no dvs for buck3, 4 */ - if (id == BUCK3 || id == BUCK4) + if (id > BUCK2) return 0; /* no dvs platform data, then dvs will be selected by I2C registers */ @@ -505,6 +505,9 @@ static int lp8788_buck_probe(struct platform_device *pdev) struct regulator_dev *rdev; int ret; + if (id >= LP8788_NUM_BUCKS) + return -EINVAL; + buck = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_buck), GFP_KERNEL); if (!buck) return -ENOMEM;