projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f89aea0
)
ASoC: dapm: Potential small memory leak in dapm_cnew_widget()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 19 Feb 2019 12:04:27 +0000
(15:04 +0300)
committer
Mark Brown
<broonie@kernel.org>
Tue, 19 Feb 2019 15:23:25 +0000
(15:23 +0000)
We should free "w" on the error path.
Fixes:
199ed3e81c49
("ASoC: dapm: fix use-after-free issue with dailink sname")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c
patch
|
blob
|
history
diff --git
a/sound/soc/soc-dapm.c
b/sound/soc/soc-dapm.c
index
dea6fc2
..
1ec06ef
100644
(file)
--- a/
sound/soc/soc-dapm.c
+++ b/
sound/soc/soc-dapm.c
@@
-332,8
+332,10
@@
static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
*/
if (_widget->sname) {
w->sname = kstrdup_const(_widget->sname, GFP_KERNEL);
- if (!w->sname)
+ if (!w->sname) {
+ kfree(w);
return NULL;
+ }
}
return w;
}