ALSA: control: potential uninitialized return value
diff mbox series

Message ID 20200108053706.h3hcnvmnf62wkjac@kili.mountain
State New
Headers show
Series
  • ALSA: control: potential uninitialized return value
Related show

Commit Message

Dan Carpenter Jan. 8, 2020, 5:37 a.m. UTC
Smatch complains that "ret" might be uninitialized.

Fixes: fbd3eb7f66c5 ("ALSA: control: Add verification for kctl accesses")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 sound/core/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Takashi Iwai Jan. 8, 2020, 6:21 a.m. UTC | #1
On Wed, 08 Jan 2020 06:37:06 +0100,
Dan Carpenter wrote:
> 
> Smatch complains that "ret" might be uninitialized.
> 
> Fixes: fbd3eb7f66c5 ("ALSA: control: Add verification for kctl accesses")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

Patch
diff mbox series

diff --git a/sound/core/control.c b/sound/core/control.c
index d06033d418a8..aa0c0cf182af 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -896,7 +896,7 @@  static int sanity_check_elem_value(struct snd_card *card,
 				   u32 pattern)
 {
 	size_t offset;
-	int i, ret;
+	int i, ret = 0;
 	u32 *p;
 
 	switch (info->type) {