diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-08-27 12:21:45 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 18:45:23 +0100 |
commit | 90cfef191a30589ef373241821233ce56d244f58 (patch) | |
tree | 7dff4414a3a92e41db06b9cbf710c5ec64a46f67 /sound/core | |
parent | e84cb5882da6d3e78964ca50fe0eade8fb8365ff (diff) | |
download | linux-stable-90cfef191a30589ef373241821233ce56d244f58.tar.gz linux-stable-90cfef191a30589ef373241821233ce56d244f58.tar.bz2 linux-stable-90cfef191a30589ef373241821233ce56d244f58.zip |
ALSA: pcm: signedness bug in snd_pcm_plug_alloc()
[ Upstream commit 6f128fa41f310e1f39ebcea9621d2905549ecf52 ]
The "frames" variable is unsigned so the error handling doesn't work
properly.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/oss/pcm_plugin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 71571d992159..31cb2acf8afc 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) while (plugin->next) { if (plugin->dst_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; plugin = plugin->next; 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) while (plugin->prev) { if (plugin->src_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; plugin = plugin->prev; err = snd_pcm_plugin_alloc(plugin, frames); |