From: Devendra Naga Date: Fri, 8 Jun 2012 19:22:11 +0000 (+0530) Subject: pinctrl: pinctrl-imx: free allocated pinctrl_map structure only once and use kernel... X-Git-Tag: v3.5-rc3~20^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a86a5f8abb33956446ae31b1e9c149d7b2d1d21;p=pandora-kernel.git pinctrl: pinctrl-imx: free allocated pinctrl_map structure only once and use kernel facilities for IMX_PMX_DUMP a) as we allocate the pinctrl_map structure at imx_dt_node_to_map at line 167, anyway if its an element, or a num_elements * (sizeof(type)) elements allocated to one single pointer must be freed only once. CASE. A) as new_map is not moved and allocated like, for (i = 0; i < MAX_ELEMS; i++) { new_map[i] = kmalloc(numelems * size, GFP_KERNEL); } its freed as for (i = 0; i < MAX_ELEMS; i++) { kfree(new_map[i]); } CASE. B) and its allocated like new_map = kmalloc(numelems * size, GFP_KERNEL); it just needs kfree not as case A's. b) use KERN_DEBUG facility for the IMX_PMX_DUMP macro. Signed-off-by: Devendra Naga Acked-by: Dong Aisheng Signed-off-by: Linus Walleij --- Reading git-diff-tree failed