Skip to content

Commit

Permalink
ALSA: pcm: potential uninitialized return values
Browse files Browse the repository at this point in the history
Smatch complains that "tmp" can be uninitialized if we do a zero size
write.

Fixes: 02a5d69 ("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>
  • Loading branch information
Dan Carpenter authored and Takashi Iwai committed Mar 27, 2018
1 parent 9066ae7 commit 5607ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,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))
Expand Down Expand Up @@ -1433,7 +1433,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))
Expand Down

0 comments on commit 5607ddd

Please sign in to comment.