From abfbbdbd081e0f32541bb1c74cd3a62fadc84f37 Mon Sep 17 00:00:00 2001 From: mav Date: Sat, 22 Nov 2008 14:48:40 +0000 Subject: Change check order to avoid array overrun. Found with: Coverity Prevent(tm) CID: 2497 --- sys/dev/sound/pci/hda/hdac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 749ad4a..86d2c61 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081115_0116" +#define HDA_DRV_TEST_REV "20081122_0117" SND_DECLARE_FILE("$FreeBSD$"); @@ -4762,7 +4762,7 @@ hdac_audio_trace_as_out(struct hdac_devinfo *devinfo, int as, int seq) nid_t min, res; /* Find next pin */ - for (i = seq; ases[as].pins[i] == 0 && i < 16; i++) + for (i = seq; i < 16 && ases[as].pins[i] == 0; i++) ; /* Check if there is no any left. If so - we succeded. */ if (i == 16) -- cgit v1.1