Commit ce36f6ad authored by Pankaj Dubey's avatar Pankaj Dubey Committed by Krzysztof Kozlowski

ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf

If no platform devices binded to the driver but driver itself loaded and
exynos_sys_powerdown_conf is called from
arch/arm/mach-exynos/{suspend.c, pm.c} it will result in NULL pointer access,
to prevent this added check on pmu_context for NULL.
Signed-off-by: default avatarPankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
parent 8005c49d
...@@ -748,8 +748,12 @@ static void exynos5_powerdown_conf(enum sys_powerdown mode) ...@@ -748,8 +748,12 @@ static void exynos5_powerdown_conf(enum sys_powerdown mode)
void exynos_sys_powerdown_conf(enum sys_powerdown mode) void exynos_sys_powerdown_conf(enum sys_powerdown mode)
{ {
unsigned int i; unsigned int i;
const struct exynos_pmu_data *pmu_data;
if (!pmu_context)
return;
const struct exynos_pmu_data *pmu_data = pmu_context->pmu_data; pmu_data = pmu_context->pmu_data;
if (pmu_data->powerdown_conf) if (pmu_data->powerdown_conf)
pmu_data->powerdown_conf(mode); pmu_data->powerdown_conf(mode);
......
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