From nobody@FreeBSD.org  Tue May 17 13:00:19 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1F0B106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 May 2011 13:00:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 83DE18FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 May 2011 13:00:19 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HD0J8r002269
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 May 2011 13:00:19 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4HD0JBL002268;
	Tue, 17 May 2011 13:00:19 GMT
	(envelope-from nobody)
Message-Id: <201105171300.p4HD0JBL002268@red.freebsd.org>
Date: Tue, 17 May 2011 13:00:19 GMT
From: Aaron Styx <aaron.styx@baesystems.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cleanup error in IGB driver - igb_setup_receive_structures()
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157118
>Category:       kern
>Synopsis:       [igb] cleanup error in igb driver - igb_setup_receive_structures()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 17 13:10:11 UTC 2011
>Closed-Date:    
>Last-Modified:  Sat May 21 22:17:23 UTC 2011
>Originator:     Aaron Styx
>Release:        7.4
>Organization:
BAE Systems
>Environment:
all
>Description:
IGB driver version 2.0.7. I'm working from the release version of FreeBSD
v7.4. 

I'm not entirely sure what would be correct here, but in the function
igb_setup_receive_structures() in the e1000 igb driver (if_igb.c), the
fail condition looks wrong. At first glance, it looks like rxr should
get rx_rings[j], not [i]. Also, that code will never be run since the
condition on the for loop is j > i, i will be >= zero, and j starts at
zero.  

-STX
>How-To-Repeat:
I have not hit this code on a running system; just looked suspicious. 
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
