Commit 89e551e8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Krzysztof Kozlowski

soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps()

The dev_pm_opp_get_opp_table() returns error pointers if it's disabled
in the config and it returns NULL if there is an error.  This code only
checks for error pointers so it could lead to an Oops inside the
dev_pm_opp_put_opp_table() function.

Fixes: 5ea42859 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 02fb2988
......@@ -93,7 +93,7 @@ static int exynos_asv_update_opps(struct exynos_asv *asv)
continue;
opp_table = dev_pm_opp_get_opp_table(cpu);
if (IS_ERR(opp_table))
if (IS_ERR_OR_NULL(opp_table))
continue;
if (!last_opp_table || opp_table != last_opp_table) {
......
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