Skip to contentSkip to conversation

PM / devfreq: exynos-bus: Fix NULL pointer dereference

PATCH In review Christian Marangi 2 participants 2 messages Jul 1, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PM / devfreq: exynos-bus: Fix NULL pointer dereference

Fix exynos-bus NULL pointer dereference by correctly using the local generated freq_table to output the debug values instead of using the profile freq_table that is not used in the driver.

Fixes b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq struct")
---
 drivers/devfreq/exynos-bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/devfreq/exynos-bus.c +3 -3
index b5615e667e31..79725bbb4bb0 100644
@@ -447,9 +447,9 @@ static int exynos_bus_probe(struct platform_device *pdev)
 		}
 	}
 
-	max_state = bus->devfreq->profile->max_state;
-	min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
-	max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
+	max_state = bus->devfreq->max_state;
+	min_freq = (bus->devfreq->freq_table[0] / 1000);
+	max_freq = (bus->devfreq->freq_table[max_state - 1] / 1000);
 	pr_info("exynos-bus: new bus device registered: %s (%6ld KHz ~ %6ld KHz)\n",
 			dev_name(dev), min_freq, max_freq);
 
Signature · 1 line
2.36.1
#1 lore raw

Dear Rafael,

The pull request[1] has an issue for exynos-bus.c devfreq driver and then fixed it by this patch.

If possible, could you please apply this patch to linux-pm.git directly for 5.19-rc5?

[1] "[GIT,PULL] devfreq fixes for 5.19-rc5"
- https://patchwork.kernel.org/project/linux-pm/patch/[email protected]/

Best Regards,
Chanwoo Choi

Quoted 35 lines · Christian Marangi

Fix exynos-bus NULL pointer dereference by correctly using the local generated freq_table to output the debug values instead of using the profile freq_table that is not used in the driver.

Fixes b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq struct")
---
 drivers/devfreq/exynos-bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/devfreq/exynos-bus.c +3 -4
index b5615e667e31..79725bbb4bb0 100644
@@ -447,9 +447,9 @@ static int exynos_bus_probe(struct platform_device *pdev)
                }
        }
 
-       max_state = bus->devfreq->profile->max_state;
-       min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
-       max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
+       max_state = bus->devfreq->max_state;
+       min_freq = (bus->devfreq->freq_table[0] / 1000);
+       max_freq = (bus->devfreq->freq_table[max_state - 1] / 1000);
        pr_info("exynos-bus: new bus device registered: %s (%6ld KHz ~ %6ld KHz)\n",
                        dev_name(dev), min_freq, max_freq);
 
--

2.36.1