]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix invalid NULL check in snd_emuusb_set_samplerate()
authorTakashi Iwai <tiwai@suse.de>
Thu, 15 Aug 2019 09:41:06 +0000 (11:41 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 21 Aug 2019 06:19:30 +0000 (08:19 +0200)
commit4dc00c13c0bc052a108f08bf4e64cbe992674ffc
treeee0a893af2cdbb736ec537e8cbb76732f7981a1c
parent9305c4e37e1d87437000cec494c91f54bcad64cb
ALSA: usb-audio: Fix invalid NULL check in snd_emuusb_set_samplerate()

The quirk function snd_emuusb_set_samplerate() has a NULL check for
the mixer element, but this is useless in the current code.  It used
to be a check against mixer->id_elems[unitid] but it was changed later
to the value after mixer_eleme_list_to_info() which is always non-NULL
due to the container_of() usage.

This patch fixes the check before the conversion.

While we're at it, correct a typo in the comment in the function,
too.

Fixes: 96889d9ab707 ("ALSA: usb-audio: Clean up mixer element list traverse")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_quirks.c