diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-08-01 07:10:49 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-08-03 19:28:15 +0200 |
commit | b5031b7db77dc47f474f0efc2b2552c32b7bb59d (patch) | |
tree | 05945a16717151f2cb1d3489f28cf52c0a1bb791 /drivers/pinctrl/intel | |
parent | gpio: tegra: Move driver registration to subsys_init level (diff) | |
download | linux-b5031b7db77dc47f474f0efc2b2552c32b7bb59d.tar.xz linux-b5031b7db77dc47f474f0efc2b2552c32b7bb59d.zip |
pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state
fixes following Smatch static check warning:
drivers/pinctrl/berlin/berlin.c:237 berlin_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: 3de68d331c24 ("pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/intel')
0 files changed, 0 insertions, 0 deletions