BACKPORT: ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit()

The parser for the processing unit reads bNrInPins field before the
bLength sanity check, which may lead to an out-of-bound access when a
malformed descriptor is given.  Fix it by assignment after the bLength
check.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit f4351a199cc120ff9d59e06d02e8657d08e6cc46)

BUG=chromium:1003337
TEST=None

Backport: usb_audio_err -> snd_printk

Change-Id: I95685345425a92705a2491f3f694e6eec1cb0f13
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1801473
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
1 file changed