]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails
authorDevendra Naga <devendra.aaru@gmail.com>
Sat, 9 Jun 2012 12:01:23 +0000 (17:31 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 12 Jun 2012 14:25:56 +0000 (16:25 +0200)
commit0e6117e77786256eb68ff8ad68cc7bf53bf4302d
tree7595ae92e141a7fa822a701192c63698cae0921a
parent26dce7882b42acca05d65ac9de2a34ef6ab372b3
pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails

if there is no purecfg , the group pointer is allocated using kzalloc and if it
fails to allocate, we wont free the new_map,

if config is true, we call kmemdup and if it
fails to do so we wont free the allocated group if there is no purecfg.

fix this by doing the frees of new_map pointer and group pointers.

Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-mxs.c