[alsa-devel] [bug report] ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk

Dan Carpenter dan.carpenter at oracle.com
Wed Feb 22 19:46:49 CET 2017


Hello Detlef Urban,

This is a semi-automatic email about new static checker warnings.

The patch d2bb390a2081: "ALSA: usb-audio: Tascam US-16x08 DSP mixer 
quirk" from Feb 20, 2017, leads to the following Smatch complaint:

sound/usb/mixer_us16x08.c:716 snd_us16x08_meter_get()
	 warn: variable dereferenced before check 'elem' (see line 711)

sound/usb/mixer_us16x08.c
   710		struct usb_mixer_elem_info *elem = kcontrol->private_data;
   711		struct snd_usb_audio *chip = elem->head.mixer->chip;
                                             ^^^^^^^^^^^^^^^^^^^^^^
Dereference.

   712		struct snd_us16x08_meter_store *store = elem->private_data;
   713		u8 meter_urb[64];
   714		char tmp[max(sizeof(mix_init_msg1), sizeof(mix_init_msg2))];
   715	
   716		if (elem) {
                    ^^^^
Check.

   717			store = (struct snd_us16x08_meter_store *) elem->private_data;
   718			chip = elem->head.mixer->chip;

regards,
dan carpenter


More information about the Alsa-devel mailing list