Commit 545fc69
Jennifer Berringer
firmware: qcom: scm: Cleanup global '__scm' on probe failures
JIRA: https://issues.redhat.com/browse/RHEL-73299
commit 1e76b54
Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Mon Dec 9 15:27:57 2024 +0100
firmware: qcom: scm: Cleanup global '__scm' on probe failures
If SCM driver fails the probe, it should not leave global '__scm'
variable assigned, because external users of this driver will assume the
probe finished successfully. For example TZMEM parts ('__scm->mempool')
are initialized later in the probe, but users of it (__scm_smc_call())
rely on the '__scm' variable.
This fixes theoretical NULL pointer exception, triggered via introducing
probe deferral in SCM driver with call trace:
qcom_tzmem_alloc+0x70/0x1ac (P)
qcom_tzmem_alloc+0x64/0x1ac (L)
qcom_scm_assign_mem+0x78/0x194
qcom_rmtfs_mem_probe+0x2d4/0x38c
platform_probe+0x68/0xc8
Fixes: 40289e3 ("firmware: qcom: scm: enable the TZ mem allocator")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241209-qcom-scm-missing-barriers-and-all-sort-of-srap-v2-4-9061013c8d92@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Jennifer Berringer <jberring@redhat.com>1 parent 1209c36 commit 545fc69
1 file changed
+29
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2022 | 2022 | | |
2023 | 2023 | | |
2024 | 2024 | | |
2025 | | - | |
2026 | | - | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
2027 | 2029 | | |
2028 | 2030 | | |
2029 | 2031 | | |
2030 | | - | |
2031 | | - | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
2032 | 2036 | | |
2033 | 2037 | | |
2034 | 2038 | | |
| |||
2047 | 2051 | | |
2048 | 2052 | | |
2049 | 2053 | | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2053 | 2059 | | |
2054 | 2060 | | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
2058 | 2066 | | |
2059 | 2067 | | |
2060 | 2068 | | |
2061 | 2069 | | |
2062 | 2070 | | |
2063 | 2071 | | |
2064 | 2072 | | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2068 | 2078 | | |
2069 | 2079 | | |
2070 | 2080 | | |
| |||
2080 | 2090 | | |
2081 | 2091 | | |
2082 | 2092 | | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2083 | 2099 | | |
2084 | 2100 | | |
2085 | 2101 | | |
| |||
0 commit comments