Skip to content

Commit

Permalink
ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdow…
Browse files Browse the repository at this point in the history
…n_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>
  • Loading branch information
Pankaj Dubey authored and Krzysztof Kozlowski committed Nov 17, 2015
1 parent 8005c49 commit ce36f6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/arm/mach-exynos/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,12 @@ static void exynos5_powerdown_conf(enum sys_powerdown mode)
void exynos_sys_powerdown_conf(enum sys_powerdown mode)
{
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)
pmu_data->powerdown_conf(mode);
Expand Down

0 comments on commit ce36f6a

Please sign in to comment.