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


Groups > linux.kernel > #1157564

[PATCH 4.0 104/148] ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.0 104/148] ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider
Date Wed, 03 Jun 2015 14:50:04 +0200
Message-ID <pxghm-1gO-57@gated-at.bofh.it> (permalink)
References <pxfOh-E4-3@gated-at.bofh.it>
X-Original-To linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.4.2
User-Agent quilt/0.64
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-15
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 53
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Krzysztof Kozlowski <k.kozlowski@samsung.com>, Kukjin Kim <kgene@kernel.org>
X-Original-Date Wed, 3 Jun 2015 21:09:34 +0900
X-Original-Message-ID <20150603114209.918252154@linuxfoundation.org>
X-Original-References <20150603114205.337615117@linuxfoundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1157564

Show key headers only | View raw


4.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

commit 0b7dc0ff95237a53287e52f1aab7408ebf1c4085 upstream.

ERR_PTR was dereferenced during sub domain parsing, if parent domain
could not be obtained (because of invalid phandle or deferred
registration of parent domain).

The Exynos power domain code checked whether
of_genpd_get_from_provider() returned NULL and in that case it skipped
that power domain node. However this function returns ERR_PTR or valid
pointer, not NULL.

Fixes: 0f7807518fe1 ("ARM: EXYNOS: add support for sub-power domains")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mach-exynos/pm_domains.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -169,7 +169,7 @@ no_clk:
 		args.np = np;
 		args.args_count = 0;
 		child_domain = of_genpd_get_from_provider(&args);
-		if (!child_domain)
+		if (IS_ERR(child_domain))
 			continue;
 
 		if (of_parse_phandle_with_args(np, "power-domains",
@@ -177,7 +177,7 @@ no_clk:
 			continue;
 
 		parent_domain = of_genpd_get_from_provider(&args);
-		if (!parent_domain)
+		if (IS_ERR(parent_domain))
 			continue;
 
 		if (pm_genpd_add_subdomain(parent_domain, child_domain))


--
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 | Next | Find similar | Unroll thread


Thread

[PATCH 4.0 104/148] ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 14:50 +0200

csiph-web