Fix an off-by-one error by adding proper range checks when parsing the

HDA association descriptors. This fixes a crash during device probe
for some HDA PCI devices.

Reported by:	David Wolfskill <david@catwhisker.org>
Reviewed by:	mav @
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2015-05-18 16:02:44 +00:00
parent 78680d05d1
commit 8dca9c27c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283064

View File

@ -3203,7 +3203,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo)
/* Scan associations skipping as=0. */
cnt = 0;
for (j = 1; j < 16; j++) {
for (j = 1; j < 16 && cnt < max; j++) {
first = 16;
hpredir = 0;
for (i = devinfo->startnode; i < devinfo->endnode; i++) {