linux/drivers/pmdomain
Karl Mehltretter 090a95dbe1 pmdomain: mediatek: mfg: initialize prev_o in mtk_mfg_attach_dev()
mtk_mfg_attach_dev() reads prev_o on the first iteration of its loop,
in "if (prev_o && prev_o->freq == o->freq)", before prev_o is assigned
at the end of the loop body. On that first iteration, evaluating prev_o
reads an indeterminate value. If it is non-NULL, the condition
dereferences a stale or invalid pointer, potentially faulting or
incorrectly skipping the first OPP.

Initialize prev_o to NULL. This matches the intent as well: there is no
previous OPP to compare against on the first iteration.

Found with Clang's -Wconditional-uninitialized.

Fixes: f08e7a4e8d ("pmdomain: mediatek: Add support for MFlexGraphics")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-08-12 11:09:12 +02:00
..
actions Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
amlogic pmdomain: amlogic: Add support for S6 S7 S7D power domains controller 2025-09-04 12:25:36 +02:00
apple pmdomain: apple: Add "apple,t8103-pmgr-pwrstate" 2025-09-18 21:30:56 +02:00
arm pmdomain: arm: Fix -EINVAL from scmi_pd_set_perf_state() on state 0 2026-08-10 15:59:19 +02:00
bcm pmdomain: bcm: bcm2835-power: Replace open-coded polling with readl_poll_timeout_atomic() 2026-04-01 13:12:11 +02:00
imx pmdomain: imx: Fix i.MX8MP VC8000E power up sequence 2026-07-08 17:11:50 +02:00
marvell Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mediatek pmdomain: mediatek: mfg: initialize prev_o in mtk_mfg_attach_dev() 2026-08-12 11:09:12 +02:00
qcom pmdomain: qcom: rpmhpd: Add missing MXC and MMCX power domains for Eliza 2026-08-11 12:18:45 +02:00
renesas Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rockchip pmdomain: rockchip: quiet regulator error on -EPROBE_DEFER 2026-04-01 13:12:11 +02:00
samsung pmdomain: samsung: Rework legacy splash-screen handover workaround 2025-11-04 17:16:05 +01:00
st Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
starfive pmdomain: starfive: Update prefixes for AON power domain 2023-10-04 23:41:57 +02:00
sunxi pmdomain: sunxi: support power domain flags for pck600 2026-06-03 11:30:38 +02:00
tegra Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
thead pmdomain: thead: Fix error pointer vs NULL bug in th1520_pd_reboot_init() 2025-09-26 14:50:20 +02:00
ti pmdomain: ti_sci: add wakeup constraint to parent devices of wakeup source 2026-06-03 11:47:20 +02:00
xilinx firmware/pmdomain: xilinx: Move ->sync_state() support to firmware driver 2025-07-09 13:29:25 +02:00
core.c pmdomain: core: fix unused variable warning with !PM_GENERIC_DOMAINS_OF 2026-06-15 21:12:35 +02:00
governor.c pmdomain core: 2025-12-04 13:50:39 -08:00
Kconfig pmdomain: marvell: Add PXA1908 power domains 2025-09-17 16:13:19 +02:00
Makefile pmdomain: marvell: Add PXA1908 power domains 2025-09-17 16:13:19 +02:00