diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2017-07-15 22:50:41 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2017-09-18 20:34:55 +0200 |
commit | 34a422794ddab738408edc7e3980ccbc14f28af4 (patch) | |
tree | 06f99aeb1acab719dea0a5743d44c2026613edbb /target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch | |
parent | e080a7ce07ee8cd63c71e1469853a233d9bc7a4c (diff) | |
download | upstream-34a422794ddab738408edc7e3980ccbc14f28af4.tar.gz upstream-34a422794ddab738408edc7e3980ccbc14f28af4.tar.bz2 upstream-34a422794ddab738408edc7e3980ccbc14f28af4.zip |
sunxi: Backport patches needed for A64
This backports multiple patches from kernel 4.10 which are adding
missing support for the A64 and the pine64 board. These are the device
tree files, the pinctlk and the clock driver.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch')
-rw-r--r-- | target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch b/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch new file mode 100644 index 0000000000..8ed4f27b4c --- /dev/null +++ b/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch @@ -0,0 +1,35 @@ +From b3cde198b17f504643cc1eeffc4623f03326f436 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter <dan.carpenter@oracle.com> +Date: Fri, 18 Nov 2016 14:35:57 +0300 +Subject: pinctrl: sunxi: Testing the wrong variable + +Smatch complains that we dereference "map" before testing it for NULL +which is true. We should be testing "*map" instead. Also on the error +path, we should free *map and set it to NULL. + +Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> +Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> +Signed-off-by: Linus Walleij <linus.walleij@linaro.org> +--- + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c +@@ -398,13 +398,14 @@ static int sunxi_pctrl_dt_node_to_map(st + * map array + */ + *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL); +- if (!map) ++ if (!*map) + return -ENOMEM; + + return 0; + + err_free_map: +- kfree(map); ++ kfree(*map); ++ *map = NULL; + return ret; + } + |