diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-27 16:07:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-08 11:49:44 +0200 |
commit | 46b7dc0470bcec486d7514a427478e1761add0c1 (patch) | |
tree | a37cd15f7d88d33d428c8a4f725afdad7f414eac | |
parent | a61083601e592212022640da7a9ce2d787cdd6b8 (diff) | |
download | linux-stable-46b7dc0470bcec486d7514a427478e1761add0c1.tar.gz linux-stable-46b7dc0470bcec486d7514a427478e1761add0c1.tar.bz2 linux-stable-46b7dc0470bcec486d7514a427478e1761add0c1.zip |
ALSA: pcm: potential uninitialized return values
commit 5607dddbfca774fb38bffadcb077fe03aa4ac5c6 upstream.
Smatch complains that "tmp" can be uninitialized if we do a zero size
write.
Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/core/oss/pcm_oss.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 743cc53daa79..520c6bed5d2b 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1362,7 +1362,7 @@ static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const cha static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const char __user *buf, size_t bytes) { size_t xfer = 0; - ssize_t tmp; + ssize_t tmp = 0; struct snd_pcm_runtime *runtime = substream->runtime; if (atomic_read(&substream->mmap_count)) @@ -1469,7 +1469,7 @@ static ssize_t snd_pcm_oss_read2(struct snd_pcm_substream *substream, char *buf, static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __user *buf, size_t bytes) { size_t xfer = 0; - ssize_t tmp; + ssize_t tmp = 0; struct snd_pcm_runtime *runtime = substream->runtime; if (atomic_read(&substream->mmap_count)) |