mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
soc: samsung: exynos-asv: handle reading revision register error
If regmap_read() fails, the product_id local variable will contain
random value from the stack. Do not try to parse such value and fail
the ASV driver probe.
Fixes: 5ea428595c
("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Link: https://lore.kernel.org/r/20201207190517.262051-3-krzk@kernel.org
This commit is contained in:
parent
0458b88267
commit
4561560dfb
@ -129,7 +129,13 @@ static int exynos_asv_probe(struct platform_device *pdev)
|
|||||||
return PTR_ERR(asv->chipid_regmap);
|
return PTR_ERR(asv->chipid_regmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PRO_ID, &product_id);
|
ret = regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PRO_ID,
|
||||||
|
&product_id);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(&pdev->dev, "Cannot read revision from ChipID: %d\n",
|
||||||
|
ret);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
switch (product_id & EXYNOS_MASK) {
|
switch (product_id & EXYNOS_MASK) {
|
||||||
case 0xE5422000:
|
case 0xE5422000:
|
||||||
|
Loading…
Reference in New Issue
Block a user