diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-09-21 03:59:41 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-09-21 18:17:27 +0200 |
commit | a4925311a5443126ecc90671a1604ea7b0f5b32e (patch) | |
tree | 13a760d46c326b9787df4bd9dbfa874249d5587a /usr | |
parent | pinctrl: mediatek: add eint support to MT6765 pinctrl driver (diff) | |
download | linux-a4925311a5443126ecc90671a1604ea7b0f5b32e.tar.xz linux-a4925311a5443126ecc90671a1604ea7b0f5b32e.zip |
pinctrl: sunxi: fix 'pctrl->functions' allocation in sunxi_pinctrl_build_state
fixes following Smatch static check warning:
./drivers/pinctrl/sunxi/pinctrl-sunxi.c:1112 sunxi_pinctrl_build_state()
warn: passing devm_ allocated variable to kfree. 'pctrl->functions'
As we will be calling krealloc() on pointer 'pctrl->functions', which means
kfree() will be called in there, devm_kzalloc() shouldn't be used with
the allocation in the first place. Fix the warning by calling kcalloc()
and managing the free procedure in error path on our own.
Fixes: 0e37f88d9ad8 ("ARM: sunxi: Add pinctrl driver for Allwinner SoCs")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions