Commit 305f254
pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe
Remove scpsys_get_legacy_regmap(), replacing its usage with
of_find_node_with_property(). Explicitly call of_node_get(np) before each
of_find_node_with_property() to maintain correct node reference counting.
The of_find_node_with_property() function "consumes" its input by calling
of_node_put() internally, whether or not it finds a match. Currently,
dev->of_node (np) is passed multiple times in sequence without incrementing
its reference count, causing it to be decremented multiple times and
risking early memory release.
Adding of_node_get(np) before each call balances the reference count,
preventing premature node release.
Fixes: c1bac49 ("pmdomains: mtk-pm-domains: Fix spinlock recursion in probe")
Cc: stable@vger.kernel.org
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Tested-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>1 parent f8f9c1f commit 305f254
1 file changed
Lines changed: 6 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | 987 | | |
1000 | 988 | | |
1001 | 989 | | |
| |||
1017 | 1005 | | |
1018 | 1006 | | |
1019 | 1007 | | |
1020 | | - | |
| 1008 | + | |
| 1009 | + | |
1021 | 1010 | | |
1022 | 1011 | | |
1023 | 1012 | | |
| |||
1030 | 1019 | | |
1031 | 1020 | | |
1032 | 1021 | | |
1033 | | - | |
| 1022 | + | |
| 1023 | + | |
1034 | 1024 | | |
1035 | 1025 | | |
1036 | 1026 | | |
| |||
1048 | 1038 | | |
1049 | 1039 | | |
1050 | 1040 | | |
1051 | | - | |
| 1041 | + | |
| 1042 | + | |
1052 | 1043 | | |
1053 | 1044 | | |
1054 | 1045 | | |
| |||
0 commit comments