Skip to content

Commit f1a1bc8

Browse files
Uwe Kleine-Königandersson
authored andcommitted
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes: a3134fb ("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>
1 parent 9b09c0f commit f1a1bc8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/soc/qcom/llcc-qcom.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,9 @@ static int qcom_llcc_probe(struct platform_device *pdev)
11201120
u32 version;
11211121
struct regmap *regmap;
11221122

1123+
if (!IS_ERR(drv_data))
1124+
return -EBUSY;
1125+
11231126
drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL);
11241127
if (!drv_data) {
11251128
ret = -ENOMEM;

0 commit comments

Comments
 (0)