From: Dan Carpenter Date: Tue, 29 Oct 2019 18:27:42 +0000 (+0300) Subject: soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps() X-Git-Tag: v5.5-rc1~40^2~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89e551e83869732d5b9fd21d7cfdb1f8d62cf5d0;p=thirdparty%2Fkernel%2Flinux.git 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: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver") Signed-off-by: Dan Carpenter Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/soc/samsung/exynos-asv.c b/drivers/soc/samsung/exynos-asv.c index 8abf4dfaa5c59..30bb7b7cc7698 100644 --- a/drivers/soc/samsung/exynos-asv.c +++ b/drivers/soc/samsung/exynos-asv.c @@ -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) {