projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
689c691
)
ALSA: Don't leak in sound/core/oss/pcm_oss.c::snd_pcm_hw_param_near()
author
Jesper Juhl
<jj@chaosbits.net>
Thu, 6 Jan 2011 21:19:47 +0000
(22:19 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Mon, 10 Jan 2011 10:13:42 +0000
(11:13 +0100)
snd_pcm_hw_param_near() will leak the memory allocated to 'save' if the
call to snd_pcm_hw_param_max() returns less than zero.
This patch makes sure we never leak.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/core/oss/pcm_oss.c
b/sound/core/oss/pcm_oss.c
index b753ec661fcfd149d079f530e05729d8d0cc524b..a2e4eb324699ace38148bd087d59e50d7d173e44 100644
(file)
--- a/
sound/core/oss/pcm_oss.c
+++ b/
sound/core/oss/pcm_oss.c
@@
-453,8
+453,10
@@
static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
} else {
*params = *save;
max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir);
- if (max < 0)
+ if (max < 0) {
+ kfree(save);
return max;
+ }
last = 1;
}
_end: