brcm2708-gpu-fw: update to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0300-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch
1 From 2b3a67805c0b48fce377b60237ee29edf90996ee Mon Sep 17 00:00:00 2001
2 From: Vladimir Zapolskiy <vz@mleia.com>
3 Date: Sun, 6 Mar 2016 03:21:35 +0200
4 Subject: [PATCH 300/304] clk: bcm2835: fix check of error code returned by
5 devm_ioremap_resource()
6
7 The change fixes potential oops while accessing iomem on invalid
8 address, if devm_ioremap_resource() fails due to some reason.
9
10 The devm_ioremap_resource() function returns ERR_PTR() and never
11 returns NULL, which makes useless a following check for NULL.
12
13 Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
14 Fixes: 5e63dcc74b30 ("clk: bcm2835: Add a driver for the auxiliary peripheral clock gates")
15 Reviewed-by: Eric Anholt <eric@anholt.net>
16 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
17 ---
18 drivers/clk/bcm/clk-bcm2835-aux.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21 --- a/drivers/clk/bcm/clk-bcm2835-aux.c
22 +++ b/drivers/clk/bcm/clk-bcm2835-aux.c
23 @@ -38,8 +38,8 @@ static int bcm2835_aux_clk_probe(struct
24
25 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
26 reg = devm_ioremap_resource(dev, res);
27 - if (!reg)
28 - return -ENODEV;
29 + if (IS_ERR(reg))
30 + return PTR_ERR(reg);
31
32 onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL);
33 if (!onecell)