diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2017-07-16 21:33:28 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-14 15:01:01 +0200 |
commit | bba2e8712602e2d8192f748f588910d1534e4baf (patch) | |
tree | 41ff63165211f8e27e43432d87d65e00eafbc7c0 /drivers/pci/setup-irq.c | |
parent | 8939aa5f5164b51b7ebd269a0443c8cd222214c4 (diff) |
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>
Diffstat (limited to 'drivers/pci/setup-irq.c')
0 files changed, 0 insertions, 0 deletions