[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241228070317.2956-1-tanyaagarwal25699@gmail.com>
Date: Sat, 28 Dec 2024 12:33:17 +0530
From: Tanya Agarwal <tanyaagarwal25699@...il.com>
To: perex@...ex.cz,
tiwai@...e.com
Cc: linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
anupnewsmail@...il.com,
tanyaagarwal25699@...il.com
Subject: [PATCH] ALSA: usb-audio: US16x08: Initialize array before use
From: Tanya Agarwal <tanyaagarwal25699@...il.com>
Initialize array before use in mixer_us16x08.c to prevent the
issues related to uninitialized memory access.
CID 1410197: (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value *meter_urb when
calling get_meter_levels_from_urb
Coverity Link:
https://scan7.scan.coverity.com/#/project-view/52849/11354?selectedIssue=1410197
Signed-off-by: Tanya Agarwal <tanyaagarwal25699@...il.com>
---
sound/usb/mixer_us16x08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c
index 6eb7d93b358d..20ac32635f1f 100644
--- a/sound/usb/mixer_us16x08.c
+++ b/sound/usb/mixer_us16x08.c
@@ -687,7 +687,7 @@ static int snd_us16x08_meter_get(struct snd_kcontrol *kcontrol,
struct usb_mixer_elem_info *elem = kcontrol->private_data;
struct snd_usb_audio *chip = elem->head.mixer->chip;
struct snd_us16x08_meter_store *store = elem->private_data;
- u8 meter_urb[64];
+ u8 meter_urb[64] = {0};
switch (kcontrol->private_value) {
case 0: {
--
2.39.5
Powered by blists - more mailing lists