Commit f1a1bc87 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Bjorn Andersson

soc: qcom: llcc: Handle a second device without data corruption

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: a3134fb0 ("drivers: soc: Add LLCC driver")
Link: https://lore.kernel.org/r/20230926083229.2073890-1-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 9b09c0f2
......@@ -1120,6 +1120,9 @@ static int qcom_llcc_probe(struct platform_device *pdev)
u32 version;
struct regmap *regmap;
if (!IS_ERR(drv_data))
return -EBUSY;
drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL);
if (!drv_data) {
ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment