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)
commit0bf7481852c8ece4888c299ba0259b789c3dbde3
tree7595ae92e141a7fa822a701192c63698cae0921a
parent67695f2eae210b0631fb92cf5649d0454953e230
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