summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-07-20 18:06:18 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-07-20 18:06:18 +0300
commit2922800a1803f6319e329bdbfd2962fd83eb5360 (patch)
tree703a9f345191fff5a67c7df4327c9087d2dd0fb0 /drivers
parentbfa3037d828050896ae52f6467b6ca2489ae6fb1 (diff)
parent98e2dd5f7a8be5cb2501a897e96910393a49f0ff (diff)
downloadlinux-2922800a1803f6319e329bdbfd2962fd83eb5360.tar.xz
Merge tag 'regulator-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fix from Mark Brown: "One fix for an issue with parsing partially specified DTs" * tag 'regulator-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: da9063: fix null pointer deref with partial DT config
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/da9063-regulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index c5dd77be558b..dfd5ec9f75c9 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -778,6 +778,9 @@ static int da9063_check_xvp_constraints(struct regulator_config *config)
const struct notification_limit *uv_l = &constr->under_voltage_limits;
const struct notification_limit *ov_l = &constr->over_voltage_limits;
+ if (!config->init_data) /* No config in DT, pointers will be invalid */
+ return 0;
+
/* make sure that only one severity is used to clarify if unchanged, enabled or disabled */
if ((!!uv_l->prot + !!uv_l->err + !!uv_l->warn) > 1) {
dev_err(config->dev, "%s: at most one voltage monitoring severity allowed!\n",