PM / devfreq: rk3399_dmc: Fix kernel oops when rockchip,pmu is absent
authorMarc Zyngier <maz@kernel.org>
Tue, 30 Jun 2020 10:05:46 +0000 (11:05 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 30 Jul 2020 08:22:57 +0000 (17:22 +0900)
commit63ef91f24f9bfc70b6446319f6cabfd094481372
tree3602a3ad48d4107531e4df228abcc05f0c9f1ad5
parent92ed301919932f777713b9172e525674157e983d
PM / devfreq: rk3399_dmc: Fix kernel oops when rockchip,pmu is absent

Booting a recent kernel on a rk3399-based system (nanopc-t4),
equipped with a recent u-boot and ATF results in an Oops due
to a NULL pointer dereference.

This turns out to be due to the rk3399-dmc driver looking for
an *undocumented* property (rockchip,pmu), and happily using
a NULL pointer when the property isn't there.

Instead, make most of what was brought in with 9173c5ceb035
("PM / devfreq: rk3399_dmc: Pass ODT and auto power down parameters
to TF-A.") conditioned on finding this property in the device-tree,
preventing the driver from exploding.

Cc: stable@vger.kernel.org
Fixes: 9173c5ceb035 ("PM / devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A.")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/rk3399_dmc.c