From owner-cvs-all Mon May 25 19:45:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA01774 for cvs-all-outgoing; Mon, 25 May 1998 19:45:06 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: (from jmb@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA01766; Mon, 25 May 1998 19:45:04 -0700 (PDT) (envelope-from jmb) From: "Jonathan M. Bresler" Message-Id: <199805260245.TAA01766@hub.freebsd.org> Subject: Re: cvs commit: src/sys/i386/isa if_zp.c In-Reply-To: <199805260228.TAA06115@freefall.freebsd.org> from "Jonathan M. Bresler" at "May 25, 98 07:28:20 pm" To: jmb@FreeBSD.ORG (Jonathan M. Bresler) Date: Mon, 25 May 1998 19:45:04 -0700 (PDT) Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk this change is not needed in -stable. "i" was shadowed(?) in -stable. when the name was changed to "j" the problem arose. from stable: { short tmp_addr[3]; int i; for (i = 0; i < 3; i++) { tmp_addr[i] = htons(read_eeprom_data(BASE, i)); } bcopy(tmp_addr, sc->arpcom.ac_enaddr, 6); } from current before the fix: { short tmp_addr[3]; int j; for (j = 0; j < 3; j++) { tmp_addr[i] = htons(read_eeprom_data(BASE, j)); } bcopy(tmp_addr, sc->arpcom.ac_enaddr, 6); } ouch! jmb ps. the fix was changing "tmp_addr[i]" to "tmp_addr[j]". Jonathan M. Bresler wrote: > jmb 1998/05/25 19:28:20 PDT > > Modified files: > sys/i386/isa if_zp.c > Log: > code was using wrong temporary variable "i", in place of "j". > i contains the contents of the EP_W0_CONFIG_CTRL register. > i was being used as the array index into an array on the stack. > > j is initialized to 0 as it should be. > > PR: kern/6757 > Reviewed by: jmb > Submitted by: Stephane E. Potvin > > Revision Changes Path > 1.47 +2 -2 src/sys/i386/isa/if_zp.c > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message