diff options
-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 dbe406b82591..d35d61b3292c 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) | |||
1043 | runtime->oss.channels = params_channels(params); | 1043 | runtime->oss.channels = params_channels(params); |
1044 | runtime->oss.rate = params_rate(params); | 1044 | runtime->oss.rate = params_rate(params); |
1045 | 1045 | ||
1046 | runtime->oss.params = 0; | ||
1047 | runtime->oss.prepare = 1; | ||
1048 | vfree(runtime->oss.buffer); | 1046 | vfree(runtime->oss.buffer); |
1049 | runtime->oss.buffer = vmalloc(runtime->oss.period_bytes); | 1047 | runtime->oss.buffer = vmalloc(runtime->oss.period_bytes); |
1048 | if (!runtime->oss.buffer) { | ||
1049 | err = -ENOMEM; | ||
1050 | goto failure; | ||
1051 | } | ||
1052 | |||
1053 | runtime->oss.params = 0; | ||
1054 | runtime->oss.prepare = 1; | ||
1050 | runtime->oss.buffer_used = 0; | 1055 | runtime->oss.buffer_used = 0; |
1051 | if (runtime->dma_area) | 1056 | if (runtime->dma_area) |
1052 | snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes)); | 1057 | snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes)); |