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: Pankaj Dubey <pankaj.dubey@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
This commit is contained in:
parent
8005c49d9a
commit
ce36f6ad86
@ -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;
|
||||||
|
|
||||||
const struct exynos_pmu_data *pmu_data = pmu_context->pmu_data;
|
if (!pmu_context)
|
||||||
|
return;
|
||||||
|
|
||||||
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user