ALSA: control: potential uninitialized return value
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 8 Jan 2020 05:37:06 +0000 (08:37 +0300)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Jan 2020 06:20:28 +0000 (07:20 +0100)
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>
Link: https://lore.kernel.org/r/20200108053706.h3hcnvmnf62wkjac@kili.mountain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c

index d06033d418a816bff85bfa07f6fb4b28f88ca51a..aa0c0cf182afb1c6c60267646efb95600e7a333a 100644 (file)
@@ -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) {