Commit 6f128fa4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

ALSA: pcm: signedness bug in snd_pcm_plug_alloc()

The "frames" variable is unsigned so the error handling doesn't work
properly.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1bb6d9e2
...@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) ...@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
while (plugin->next) { while (plugin->next) {
if (plugin->dst_frames) if (plugin->dst_frames)
frames = plugin->dst_frames(plugin, frames); frames = plugin->dst_frames(plugin, frames);
if (snd_BUG_ON(frames <= 0)) if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
return -ENXIO; return -ENXIO;
plugin = plugin->next; plugin = plugin->next;
err = snd_pcm_plugin_alloc(plugin, frames); err = snd_pcm_plugin_alloc(plugin, frames);
...@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) ...@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
while (plugin->prev) { while (plugin->prev) {
if (plugin->src_frames) if (plugin->src_frames)
frames = plugin->src_frames(plugin, frames); frames = plugin->src_frames(plugin, frames);
if (snd_BUG_ON(frames <= 0)) if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
return -ENXIO; return -ENXIO;
plugin = plugin->prev; plugin = plugin->prev;
err = snd_pcm_plugin_alloc(plugin, frames); err = snd_pcm_plugin_alloc(plugin, frames);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment