mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
soc: qcom: llcc: Handle a second device without data corruption
[ Upstream commit f1a1bc8775b26345aba2be278118999e7f661d3d ] Usually there is only one llcc device. But if there were a second, even a failed probe call would modify the global drv_data pointer. So check if drv_data is valid before overwriting it. Change-Id: Ie9bcc0686959b0c3bfb740963eed3ba399ed735e Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes:a3134fb09e("drivers: soc: Add LLCC driver") Git-commit:cc1a1dcb41Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Link: https://lore.kernel.org/r/20230926083229.2073890-1-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: kamasali Satyanarayan <quic_kamasali@quicinc.com>
This commit is contained in:
parent
9c9c087a1b
commit
7ba19e773b
1 changed files with 3 additions and 0 deletions
|
|
@ -379,6 +379,9 @@ int qcom_llcc_probe(struct platform_device *pdev,
|
|||
struct platform_device *llcc_edac, *llcc_perfmon;
|
||||
struct device_node *tcm_memory_node;
|
||||
|
||||
if (!IS_ERR(drv_data))
|
||||
return -EBUSY;
|
||||
|
||||
drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL);
|
||||
if (!drv_data) {
|
||||
ret = -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue