Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: mpq7920: Check the correct variable in mpq7920_regulator_register()

There is a typo in the error checking. We should be checking
"->rdev[i]" instead of just "->rdev".

Fixes: 6501c1f54a17 ("regulator: mpq7920: add mpq7920 regulator driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200113125805.xri6jqoxy2ldzqyg@kili.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
7eec6786 686f6361

+2 -2
+2 -2
drivers/regulator/mpq7920.c
··· 274 274 275 275 info->rdev[i] = devm_regulator_register(info->dev, rdesc, 276 276 config); 277 - if (IS_ERR(info->rdev)) 278 - return PTR_ERR(info->rdev); 277 + if (IS_ERR(info->rdev[i])) 278 + return PTR_ERR(info->rdev[i]); 279 279 } 280 280 281 281 return 0;