ALSA: usb-audio - Fix possible access over audio_feature_info[] array
authorTakashi Iwai <tiwai@suse.de>
Thu, 13 Oct 2011 06:19:09 +0000 (08:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 13 Oct 2011 06:19:09 +0000 (08:19 +0200)
The audio_feature_info[] array should contain all entries for UAC2_FU_*,
but currently a few last entries are missing.  Even though, the driver
tries to probe these entries in parse_audio_feature_unit() and may
access the range over the array.  This patch fixes the bug by limiting
the loop size properly using ARRAY_SIZE() instead of a hard-coded
magic number.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

No differences found