OSDN Git Service

regulator: da9063: better fix null deref with partial DT
authorMartin Fuzzey <martin.fuzzey@flowbird.group>
Fri, 4 Aug 2023 08:34:30 +0000 (10:34 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 4 Aug 2023 12:26:53 +0000 (13:26 +0100)
commit30c694fd4a99fbbc4115d180156ca01b60953371
treebe4850ddee00cba62d12136ab75690bdd321b528
parent5d0c230f1de8c7515b6567d9afba1f196fb4e2f4
regulator: da9063: better fix null deref with partial DT

Two versions of the original patch were sent but V1 was merged instead
of V2 due to a mistake.

So update to V2.

The advantage of V2 is that it completely avoids dereferencing the pointer,
even just to take the address, which may fix problems with some compilers.
Both versions work on my gcc 9.4 but use the safer one.

Fixes: 98e2dd5f7a8b ("regulator: da9063: fix null pointer deref with partial DT config")
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Tested-by: Benjamin Bara <benjamin.bara@skidata.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230804083514.1887124-1-martin.fuzzey@flowbird.group
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/da9063-regulator.c