summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-04-15 15:28:52 +0200
committerTakashi Iwai <tiwai@suse.de>2016-04-15 15:28:52 +0200
commita19c921fca0a865b657d59b2c9a05aa0a2905126 (patch)
tree70582d87dc553510c3471cc6592f4693b4fd2306
parent3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4 (diff)
downloadlwn-a19c921fca0a865b657d59b2c9a05aa0a2905126.tar.gz
lwn-a19c921fca0a865b657d59b2c9a05aa0a2905126.zip
ALSA: lx646es: Fix possible uninitialized variable reference
lx_pipe_state() checks the return value from lx_message_send_atomic() and breaks the loop only when it's a negative value. However, lx_message_send_atomic() may return a positive error code (as the return code from the hardware), and then lx_pipe_state() tries to compare the uninitialized current_state variable. Fix this behavior by checking the positive non-zero error code as well. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/lx6464es/lx_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index f3d62020ef66..a80684bdc30d 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -644,7 +644,7 @@ static int lx_pipe_wait_for_state(struct lx6464es *chip, u32 pipe,
if (err < 0)
return err;
- if (current_state == state)
+ if (!err && current_state == state)
return 0;
mdelay(1);