aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2018-12-11 15:07:45 -0500
committerAndy Gross <andy.gross@linaro.org>2019-02-12 16:27:14 -0500
commit72d1cd033154f50e77cd4feb4e16c227b598632e (patch)
tree06fbf3e0029aa0de953db993e49ae8cef4fb1423 /include/linux
parent4e2256d31f0f24107c36dae35a1d84dff0fced30 (diff)
qcom: soc: llcc-slice: Clear the global drv_data pointer on error
Currently the data structure for llc-slice is devm allocated and stored as a global but never cleared if the probe function fails. This is a problem because devm managed memory gets freed on probe failure the API functions could access the pointer after it has been freed. Initialize the drv_data pointer to an error and reset it to an error on probe failure or device destroy and add protection to the API functions to make sure the memory doesn't get accessed. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/soc/qcom/llcc-qcom.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
index 69c285b1c990..eb71a50b8afc 100644
--- a/include/linux/soc/qcom/llcc-qcom.h
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -162,6 +162,12 @@ int llcc_slice_deactivate(struct llcc_slice_desc *desc);
162 */ 162 */
163int qcom_llcc_probe(struct platform_device *pdev, 163int qcom_llcc_probe(struct platform_device *pdev,
164 const struct llcc_slice_config *table, u32 sz); 164 const struct llcc_slice_config *table, u32 sz);
165
166/**
167 * qcom_llcc_remove - remove the sct table
168 * @pdev: Platform device pointer
169 */
170int qcom_llcc_remove(struct platform_device *pdev);
165#else 171#else
166static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid) 172static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
167{ 173{