Shawn Guo bba2e87126 pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state()
It fixes the following Smatch static check warning:

 drivers/pinctrl/zte/pinctrl-zx.c:338 zx_pinctrl_build_state()
 warn: passing devm_ allocated variable to kfree.

As we will be calling krealloc() on pointer '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.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: cbff0c4d27f4 ("pinctrl: add ZTE ZX pinctrl driver support")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-14 15:01:01 +02:00
..
2017-08-13 12:33:35 -07:00
2017-08-13 12:44:18 -07:00
2017-07-08 12:36:50 -07:00
2017-07-24 17:38:21 +02:00
2017-07-04 14:28:22 -07:00
2017-07-17 15:00:47 +02:00
2017-07-03 20:55:59 -07:00
2017-08-07 13:30:40 -04:00
2017-07-06 11:32:40 -07:00
2017-07-04 14:47:47 -07:00
2017-07-11 09:55:47 -07:00
2017-07-01 14:30:39 -07:00
2017-08-01 20:11:02 -05:00
2017-08-01 15:22:55 -07:00
2017-07-13 11:49:52 -07:00
2017-07-05 17:09:27 -07:00
2017-07-04 14:47:47 -07:00
2017-07-06 15:38:31 -07:00
2017-07-13 12:15:06 -07:00
2017-08-13 12:30:17 -07:00
2017-08-13 12:41:58 -07:00
2017-08-13 12:33:35 -07:00
2017-08-13 12:27:42 -07:00
2017-07-03 20:27:48 -07:00