android_kernel_motorola_sm6375/drivers/firmware
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sudeep Holla 18249a167f pmdomain: arm: scmi: Fix genpd leak on provider registration failure
[ Upstream commit 7458f72cc28f9eb0de811effcb5376d0ec19094a ]

If of_genpd_add_provider_onecell() fails during probe, the previously
created generic power domains are not removed, leading to a memory leak
and potential kernel crash later in genpd_debug_add().

Add proper error handling to unwind the initialized domains before
returning from probe to ensure all resources are correctly released on
failure.

Example crash trace observed without this fix:

  | Unable to handle kernel paging request at virtual address fffffffffffffc70
  | CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.18.0-rc1 #405 PREEMPT
  | Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform
  | pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  | pc : genpd_debug_add+0x2c/0x160
  | lr : genpd_debug_init+0x74/0x98
  | Call trace:
  |  genpd_debug_add+0x2c/0x160 (P)
  |  genpd_debug_init+0x74/0x98
  |  do_one_initcall+0xd0/0x2d8
  |  do_initcall_level+0xa0/0x140
  |  do_initcalls+0x60/0xa8
  |  do_basic_setup+0x28/0x40
  |  kernel_init_freeable+0xe8/0x170
  |  kernel_init+0x2c/0x140
  |  ret_from_fork+0x10/0x20

Fixes: 898216c97e ("firmware: arm_scmi: add device power domain support using genpd")
Signed-off-by: Sudeep Holla <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Cc: [email protected]
Signed-off-by: Ulf Hansson <[email protected]>
[ drivers/pmdomain/arm/scmi_pm_domain.c -> drivers/firmware/arm_scmi/scmi_pm_domain.c ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2025-12-03 12:45:21 +01:00
..
arm_scmi pmdomain: arm: scmi: Fix genpd leak on provider registration failure 2025-12-03 12:45:21 +01:00
broadcom
efi tpm: fix signed/unsigned bug when checking event logs 2024-12-14 19:44:24 +01:00
google firmware: google: Unregister driver_info on failure 2024-12-14 19:44:23 +01:00
imx firmware: imx-scu: fix OF node leak in .probe() 2025-04-10 14:29:37 +02:00
meson firmware: meson_sm: fix device leak at probe 2025-10-29 13:59:52 +01:00
psci firmware: psci: Fix refcount leak in psci_dt_init 2025-06-27 11:02:46 +01:00
tegra firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp() 2024-11-08 16:20:39 +01:00
xilinx
arm_scpi.c firmware: arm_scpi: Check the DVFS OPP count returned by the firmware 2024-12-14 19:44:24 +01:00
arm_sdei.c firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state() 2024-11-08 16:20:53 +01:00
dmi-id.c firmware: dmi-id: add a release callback function 2024-06-16 13:28:41 +02:00
dmi-sysfs.c
dmi_scan.c firmware: dmi: Stop decoding on broken entry 2024-07-18 11:40:48 +02:00
edd.c
iscsi_ibft.c iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() 2025-04-10 14:29:36 +02:00
iscsi_ibft_find.c
Kconfig firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry 2025-03-13 12:43:05 +01:00
Makefile
memmap.c
pcdp.c
pcdp.h
qcom_scm-32.c
qcom_scm-64.c
qcom_scm.c
qcom_scm.h
qemu_fw_cfg.c
raspberrypi.c
scpi_pm_domain.c
stratix10-rsu.c
stratix10-svc.c
ti_sci.c
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c firmware: turris-mox-rwtm: Initialize completion before mailbox 2024-08-19 05:33:28 +02:00