From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 14:48:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDF7A106564A; Sat, 22 Nov 2008 14:48:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A342F8FC1C; Sat, 22 Nov 2008 14:48:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAMEme2M020553; Sat, 22 Nov 2008 14:48:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAMEmeif020552; Sat, 22 Nov 2008 14:48:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811221448.mAMEmeif020552@svn.freebsd.org> From: Alexander Motin Date: Sat, 22 Nov 2008 14:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185176 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 14:48:40 -0000 Author: mav Date: Sat Nov 22 14:48:40 2008 New Revision: 185176 URL: http://svn.freebsd.org/changeset/base/185176 Log: Change check order to avoid array overrun. Found with: Coverity Prevent(tm) CID: 2497 Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sat Nov 22 14:24:55 2008 (r185175) +++ head/sys/dev/sound/pci/hda/hdac.c Sat Nov 22 14:48:40 2008 (r185176) @@ -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_devi 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)