From aacc268cae6c848a8566511ef5c2bdf782fad28c Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Wed, 14 Jul 2021 18:56:45 +0800 Subject: [PATCH] PM / devfreq: rockchip_bus: Fix invalid member dereference of cpufreq_freqs Signed-off-by: Finley Xiao Change-Id: I45521ebb19283f3e14a75974b25b8a8d4c64bde1 --- drivers/devfreq/rockchip_bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/rockchip_bus.c b/drivers/devfreq/rockchip_bus.c index 663fda7e0f9e..e2017c71331f 100644 --- a/drivers/devfreq/rockchip_bus.c +++ b/drivers/devfreq/rockchip_bus.c @@ -347,7 +347,7 @@ static int rockchip_bus_cpufreq_notifier(struct notifier_block *nb, { struct rockchip_bus *bus = to_rockchip_bus_cpufreq_nb(nb); struct cpufreq_freqs *freqs = data; - int id = topology_physical_package_id(freqs->cpu); + int id = topology_physical_package_id(freqs->policy->cpu); if (id < 0 || id >= MAX_CLUSTERS) return NOTIFY_DONE; @@ -363,7 +363,7 @@ static int rockchip_bus_cpufreq_notifier(struct notifier_block *nb, bus->cpu_freq[CLUSTER1] > bus->cpu_high_freq) && bus->cur_rate != bus->high_rate) { dev_dbg(bus->dev, "cpu%d freq=%d %d, up cci rate to %lu\n", - freqs->cpu, + freqs->policy->cpu, bus->cpu_freq[CLUSTER0], bus->cpu_freq[CLUSTER1], bus->high_rate); @@ -376,7 +376,7 @@ static int rockchip_bus_cpufreq_notifier(struct notifier_block *nb, bus->cpu_freq[CLUSTER1] <= bus->cpu_high_freq && bus->cur_rate != bus->low_rate) { dev_dbg(bus->dev, "cpu%d freq=%d %d, down cci rate to %lu\n", - freqs->cpu, + freqs->policy->cpu, bus->cpu_freq[CLUSTER0], bus->cpu_freq[CLUSTER1], bus->low_rate);