mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
soc: qcom: llcc: Handle a second device without data corruption
[ Upstream commitf1a1bc8775
] 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. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes:a3134fb09e
("drivers: soc: Add LLCC driver") 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>
This commit is contained in:
parent
19b8098f73
commit
995ee1e84e
@ -537,6 +537,9 @@ static int qcom_llcc_probe(struct platform_device *pdev)
|
||||
u32 sz;
|
||||
u32 version;
|
||||
|
||||
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 New Issue
Block a user