The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tanya Agarwal <tanyaagarwal25699@gmail.com>
To: perex@perex.cz, tiwai@suse.com
Cc: onkel@paraair.de, Markus.Elfring@web.de,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	skhan@linuxfoundation.org, anupnewsmail@gmail.com,
	tanyaagarwal25699@gmail.com
Subject: [PATCH V2] ALSA: usb-audio: US16x08: Initialize array before use
Date: Sun, 29 Dec 2024 11:32:42 +0530	[thread overview]
Message-ID: <20241229060240.1642-1-tanyaagarwal25699@gmail.com> (raw)

From: Tanya Agarwal <tanyaagarwal25699@gmail.com>

Initialize meter_urb array before use in mixer_us16x08.c.

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

Fixes: d2bb390a2081 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Signed-off-by: Tanya Agarwal <tanyaagarwal25699@gmail.com>
---
Changes in V2:
- Updated commit text
- Link to V1: https://lore.kernel.org/all/20241228070317.2956-1-tanyaagarwal25699@gmail.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


             reply	other threads:[~2024-12-29  6:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-29  6:02 Tanya Agarwal [this message]
2024-12-29  8:27 ` [PATCH V2] ALSA: usb-audio: US16x08: Initialize array before use Takashi Iwai
2024-12-29 11:03   ` Tanya Agarwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241229060240.1642-1-tanyaagarwal25699@gmail.com \
    --to=tanyaagarwal25699@gmail.com \
    --cc=Markus.Elfring@web.de \
    --cc=anupnewsmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=onkel@paraair.de \
    --cc=perex@perex.cz \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox