1
0
Fork 0
alistair23-linux/drivers/pinctrl/berlin
YueHaibing b5031b7db7 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: 3de68d331c ("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>
2018-08-03 19:28:15 +02:00
..
Kconfig pinctrl: berlin: add the as370 SoC pinctrl driver 2018-07-29 21:42:32 +02:00
Makefile pinctrl: berlin: add the as370 SoC pinctrl driver 2018-07-29 21:42:32 +02:00
berlin-bg2.c pinctrl: berlin: switch to SPDX license identifier 2018-05-23 11:45:23 +02:00
berlin-bg2cd.c pinctrl: berlin: switch to SPDX license identifier 2018-05-23 11:45:23 +02:00
berlin-bg2q.c pinctrl: berlin: switch to SPDX license identifier 2018-05-23 11:45:23 +02:00
berlin-bg4ct.c pinctrl: berlin: switch to SPDX license identifier 2018-05-23 11:45:23 +02:00
berlin.c pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state 2018-08-03 19:28:15 +02:00
berlin.h pinctrl: berlin: switch to SPDX license identifier 2018-05-23 11:45:23 +02:00
pinctrl-as370.c pinctrl: berlin: add the as370 SoC pinctrl driver 2018-07-29 21:42:32 +02:00