]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:23:36 +0000 (10:23 +0200)
commit4f3c293ccffe122d53f12c23e9116e8bd0361e62
tree15855838938a7e24f909d5887abe2c1e4e18d6ac
parentee26f3722d2b0a14bd88c19ffafa6975d1cdf4de
ALSA: usb-audio: Fix invalid NULL check in snd_emuusb_set_samplerate()

commit 6de3c9e3f6b3eaf66859e1379b3f35dda781416b upstream.

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: 8c558076c740 ("ALSA: usb-audio: Clean up mixer element list traverse")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/mixer_quirks.c