mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
pinctrl: pinctrl-imx: free if of_get_parent fails to get the parent node
of_get_parent can return null if no parent node found, so the allocated new_map should be freed. Signed-off-by: Devendra Naga <[email protected]> Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
3a86a5f8ab
commit
c71157c54a
1 changed files with 3 additions and 1 deletions
|
|
@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
|
||||
/* create mux map */
|
||||
parent = of_get_parent(np);
|
||||
if (!parent)
|
||||
if (!parent) {
|
||||
kfree(new_map);
|
||||
return -EINVAL;
|
||||
}
|
||||
new_map[0].type = PIN_MAP_TYPE_MUX_GROUP;
|
||||
new_map[0].data.mux.function = parent->name;
|
||||
new_map[0].data.mux.group = np->name;
|
||||
|
|
|
|||
Loading…
Reference in a new issue