mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
pinctrl: Fix potential memory leak in pinctrl_register_one_pin()
'pindesc' was not freed when returning from an error induced exit path. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
4c854723c8
commit
eb26cc9c71
1 changed files with 3 additions and 1 deletions
|
|
@ -230,8 +230,10 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
|
|||
pindesc->name = name;
|
||||
} else {
|
||||
pindesc->name = kasprintf(GFP_KERNEL, "PIN%u", number);
|
||||
if (pindesc->name == NULL)
|
||||
if (pindesc->name == NULL) {
|
||||
kfree(pindesc);
|
||||
return -ENOMEM;
|
||||
}
|
||||
pindesc->dynamic_name = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue