Patch "regulator: da9063: fix null pointer deref with partial DT config" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    regulator: da9063: fix null pointer deref with partial DT config

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     regulator-da9063-fix-null-pointer-deref-with-partial.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 91572c4910ad8526b74672f2e2764d2f86dc2152
Author: Martin Fuzzey <martin.fuzzey@flowbird.group>
Date:   Fri Jun 16 16:36:28 2023 +0200

    regulator: da9063: fix null pointer deref with partial DT config
    
    [ Upstream commit 98e2dd5f7a8be5cb2501a897e96910393a49f0ff ]
    
    When some of the da9063 regulators do not have corresponding DT nodes
    a null pointer dereference occurs on boot because such regulators have
    no init_data causing the pointers calculated in
    da9063_check_xvp_constraints() to be invalid.
    
    Do not dereference them in this case.
    
    Fixes: b8717a80e6ee ("regulator: da9063: implement setter for voltage monitoring")
    Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
    Link: https://lore.kernel.org/r/20230616143736.2946173-1-martin.fuzzey@flowbird.group
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index c5dd77be558b6..dfd5ec9f75c90 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",



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux