Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270893

[PATCH v6 2/9] ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf

From Pankaj Dubey <pankaj.dubey@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v6 2/9] ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf
Date 2015-11-17 07:20 +0100
Message-ID <qvHMu-1gI-7@gated-at.bofh.it> (permalink)
References <qvHCN-1dg-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 arch/arm/mach-exynos/pmu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 64ea7d6..d40f7e9 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -749,8 +749,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);
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 0/9] samsung: pmu: split up SoC specific PMU data Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:10 +0100
  [PATCH v6 6/9] ARM: EXYNOS: split up exynos5250 SoC specific PMU data Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  Re: [PATCH v6 0/9] samsung: pmu: split up SoC specific PMU data Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 7/9] ARM: EXYNOS: split up exynos5420 SoC specific PMU data Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 2/9] ARM: EXYNOS: Fix potential NULL pointer access in  exynos_sys_powerdown_conf Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  Re: [PATCH v6 9/9] drivers: soc: Add support for Exynos PMU driver Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 9/9] drivers: soc: Add support for Exynos PMU driver Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 1/9] ARM: EXYNOS: removing redundant code from regs-pmu.h Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 8/9] ARM: EXYNOS: rearrange static and non-static functions  of PMU driver Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
    Re: [PATCH v6 8/9] ARM: EXYNOS: rearrange static and non-static  functions of PMU driver Manish Badarkhe <badarkhe.manish@gmail.com> - 2015-11-20 05:50 +0100
      Re: [PATCH v6 8/9] ARM: EXYNOS: rearrange static and non-static  functions of PMU driver Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-11-20 06:20 +0100
  [PATCH v6 4/9] ARM: EXYNOS: split up exynos3250 SoC specific PMU data Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 5/9] ARM: EXYNOS: split up exynos4 SoC specific PMU data Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100
  [PATCH v6 3/9] ARM: EXYNOS: Move pmu specific headers under  "linux/soc/samsung" Pankaj Dubey <pankaj.dubey@samsung.com> - 2015-11-17 07:20 +0100

csiph-web