diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-09-10 15:32:58 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-09-10 15:32:58 +0200 |
commit | fa285190025d0b9a35ed0f6233bfaa721281e0f4 (patch) | |
tree | b82ba1f315aa10440af14c4adc64a24aa0e18325 /sound/core | |
parent | 9cd9f4276766e15be40d09f77e28656797a1b06f (diff) | |
parent | cbbb05703da4b205bb17fde555d3b2926d8b3194 (diff) | |
download | kernel_samsung_tuna-fa285190025d0b9a35ed0f6233bfaa721281e0f4.zip kernel_samsung_tuna-fa285190025d0b9a35ed0f6233bfaa721281e0f4.tar.gz kernel_samsung_tuna-fa285190025d0b9a35ed0f6233bfaa721281e0f4.tar.bz2 |
Merge branch 'topic/oss' into for-linus
* topic/oss:
ALSA: allocation may fail in snd_pcm_oss_change_params()
sound: vwsnd: Fix setting of cfgval and ctlval in li_setup_dma()
sound: fix OSS MIDI output data loss
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/oss/pcm_oss.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index d8b2d76..d9c9635 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1043,10 +1043,15 @@ static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream) runtime->oss.channels = params_channels(params); runtime->oss.rate = params_rate(params); - runtime->oss.params = 0; - runtime->oss.prepare = 1; vfree(runtime->oss.buffer); runtime->oss.buffer = vmalloc(runtime->oss.period_bytes); + if (!runtime->oss.buffer) { + err = -ENOMEM; + goto failure; + } + + runtime->oss.params = 0; + runtime->oss.prepare = 1; runtime->oss.buffer_used = 0; if (runtime->dma_area) snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes)); |