diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-07-29 13:49:32 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-07 22:29:39 +0200 |
commit | 3efa921d5b50c045259f6556262fed77dfecec86 (patch) | |
tree | cf61781afd602bd24f316c90066fc956bf00f293 /drivers/pinctrl/pinctrl-sunxi.c | |
parent | 8a9dcc3ffed66bf6f66c45b11f34de02b0fda4a0 (diff) |
pinctrl: sunxi: Fix incorrect NULL check
*map should be tested for NULL instead of map as kmalloc pointer
is assigned to it. This also fixes a potential null pointer dereference
bug later in the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-sunxi.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-sunxi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index c47fd1e5450b..3655a5a85ac0 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c @@ -175,7 +175,7 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, } *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL); - if (!map) + if (!*map) return -ENOMEM; of_property_for_each_string(node, "allwinner,pins", prop, group) { |