Skip to contentSkip to conversation

Patch "clk: bcm2835: fix check of error code returned by devm_ioremap_resource()" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message May 6, 2016

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

clk: bcm2835: fix check of error code returned by devm_ioremap_resource()

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
clk-bcm2835-fix-check-of-error-code-returned-by-devm_ioremap_resource.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 4d3ac6662452060721599a3392bc2f524af984cb Mon Sep 17 00:00:00 2001

From: Vladimir Zapolskiy <[email protected]>
Date: Sun, 6 Mar 2016 03:21:35 +0200
Subject: clk: bcm2835: fix check of error code returned by devm_ioremap_resource()

From: Vladimir Zapolskiy <[email protected]>

commit 4d3ac6662452060721599a3392bc2f524af984cb upstream.

The change fixes potential oops while accessing iomem on invalid address, if devm_ioremap_resource() fails due to some reason.

The devm_ioremap_resource() function returns ERR_PTR() and never returns NULL, which makes useless a following check for NULL.

Fixes 5e63dcc74b30 ("clk: bcm2835: Add a driver for the auxiliary peripheral clock gates")
---
 drivers/clk/bcm/clk-bcm2835-aux.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/bcm/clk-bcm2835-aux.c +2 -2
@@ -38,8 +38,8 @@ static int bcm2835_aux_clk_probe(struct
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg = devm_ioremap_resource(dev, res);
-	if (!reg)
-		return -ENODEV;
+	if (IS_ERR(reg))
+		return PTR_ERR(reg);
 
 	onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL);
 	if (!onecell)

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/clk-bcm2835-fix-check-of-error-code-returned-by-devm_ioremap_resource.patch