diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-03-05 20:21:35 -0500 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-03-15 21:14:11 -0400 |
commit | 4d3ac6662452060721599a3392bc2f524af984cb (patch) | |
tree | ce96ba06e0e2ecc0522bea8e6d9a9ccdb92a5772 | |
parent | e8087b5b90b2aa0a307e57e1a209a91d60da268b (diff) |
clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
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.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Fixes: 5e63dcc74b30 ("clk: bcm2835: Add a driver for the auxiliary peripheral clock gates")
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/bcm/clk-bcm2835-aux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c index e4f89e28b5ec..3a177ade6e6c 100644 --- a/drivers/clk/bcm/clk-bcm2835-aux.c +++ b/drivers/clk/bcm/clk-bcm2835-aux.c | |||
@@ -38,8 +38,8 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) | |||
38 | 38 | ||
39 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 39 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
40 | reg = devm_ioremap_resource(dev, res); | 40 | reg = devm_ioremap_resource(dev, res); |
41 | if (!reg) | 41 | if (IS_ERR(reg)) |
42 | return -ENODEV; | 42 | return PTR_ERR(reg); |
43 | 43 | ||
44 | onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL); | 44 | onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL); |
45 | if (!onecell) | 45 | if (!onecell) |