projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c85472
)
pinctrl: Fix potential memory leak in pinctrl_register_one_pin()
author
Sachin Kamat
<sachin.kamat@linaro.org>
Tue, 25 Sep 2012 07:11:40 +0000
(12:41 +0530)
committer
Linus Walleij
<linus.walleij@linaro.org>
Thu, 27 Sep 2012 11:43:14 +0000
(13:43 +0200)
'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>
drivers/pinctrl/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/pinctrl/core.c
b/drivers/pinctrl/core.c
index dc5c126e398a0ac84fc13fa5f564d832ade0831e..0f1ec9e8ff14b02448877cb4f4872f45baeeccd3 100644
(file)
--- a/
drivers/pinctrl/core.c
+++ b/
drivers/pinctrl/core.c
@@
-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;
}