linux/drivers/clk/mmp
Lubomir Rintel eca01d5911 clk: mmp2: call pm_genpd_init() only after genpd.name is set
commit e24b15d470 upstream.

Setting the genpd's struct device's name with dev_set_name() is
happening within pm_genpd_init(). If it remains NULL, things can blow up
later, such as when crafting the devfs hierarchy for the power domain:

  Unable to handle kernel NULL pointer dereference at virtual address 00000000 when read
  ...
  Call trace:
   strlen from start_creating+0x90/0x138
   start_creating from debugfs_create_dir+0x20/0x178
   debugfs_create_dir from genpd_debug_add.part.0+0x4c/0x144
   genpd_debug_add.part.0 from genpd_debug_init+0x74/0x90
   genpd_debug_init from do_one_initcall+0x5c/0x244
   do_one_initcall from kernel_init_freeable+0x19c/0x1f4
   kernel_init_freeable from kernel_init+0x1c/0x12c
   kernel_init from ret_from_fork+0x14/0x28

Bisecting tracks this crash back to commit 899f44531f ("pmdomain: core:
Add GENPD_FLAG_DEV_NAME_FW flag"), which exchanges use of genpd->name
with dev_name(&genpd->dev) in genpd_debug_add.part().

Fixes: 899f44531f ("pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag")
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Cc: stable@vger.kernel.org # v6.12+
Link: https://lore.kernel.org/r/20241231190336.423172-1-lkundrak@v3.sk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-02-17 10:05:09 +01:00
..
clk-apbc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
clk-apmu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
clk-audio.c clk: Switch back to struct platform_driver::remove() 2024-09-21 14:12:05 -07:00
clk-frac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
clk-gate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
clk-mix.c clk: mmp: Switch to use kmemdup_array() 2024-08-14 17:37:25 -07:00
clk-of-mmp2.c clk: mmp2: Move number of clocks to driver source 2023-08-22 14:13:45 -07:00
clk-of-pxa168.c clk: mmp: pxa168: Fix memory leak in pxa168_clk_init() 2023-12-16 17:15:06 -08:00
clk-of-pxa910.c clk: pxa910: Move number of clocks to driver source 2023-08-22 14:14:17 -07:00
clk-of-pxa1928.c clk: pxa1928: Move number of clocks to driver source 2023-08-22 14:14:14 -07:00
clk-pll.c clk: mmp2: fix link error without mmp2 2020-04-13 12:20:06 -07:00
clk.c clk: mmp2: fix link error without mmp2 2020-04-13 12:20:06 -07:00
clk.h This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
Makefile clk: mmp: Remove old non-OF clock drivers 2023-08-22 14:13:11 -07:00
pwr-island.c clk: mmp2: call pm_genpd_init() only after genpd.name is set 2025-02-17 10:05:09 +01:00
reset.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reset.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00