aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/compress_offload.c3
-rw-r--r--sound/core/pcm_lib.c13
2 files changed, 6 insertions, 10 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index a5b09e75e787..f7d2b373da0a 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -541,7 +541,8 @@ static int snd_compress_check_input(struct snd_compr_params *params)
541{ 541{
542 /* first let's check the buffer parameter's */ 542 /* first let's check the buffer parameter's */
543 if (params->buffer.fragment_size == 0 || 543 if (params->buffer.fragment_size == 0 ||
544 params->buffer.fragments > INT_MAX / params->buffer.fragment_size) 544 params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
545 params->buffer.fragments == 0)
545 return -EINVAL; 546 return -EINVAL;
546 547
547 /* now codec parameters */ 548 /* now codec parameters */
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 40013b26f671..6c0b30391ba9 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2177,16 +2177,11 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
2177 snd_pcm_update_hw_ptr(substream); 2177 snd_pcm_update_hw_ptr(substream);
2178 2178
2179 if (!is_playback && 2179 if (!is_playback &&
2180 runtime->status->state == SNDRV_PCM_STATE_PREPARED) { 2180 runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
2181 if (size >= runtime->start_threshold) { 2181 size >= runtime->start_threshold) {
2182 err = snd_pcm_start(substream); 2182 err = snd_pcm_start(substream);
2183 if (err < 0) 2183 if (err < 0)
2184 goto _end_unlock;
2185 } else {
2186 /* nothing to do */
2187 err = 0;
2188 goto _end_unlock; 2184 goto _end_unlock;
2189 }
2190 } 2185 }
2191 2186
2192 avail = snd_pcm_avail(substream); 2187 avail = snd_pcm_avail(substream);