From owner-cvs-all Sun Oct 20 11:20:45 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7188937B401; Sun, 20 Oct 2002 11:20:44 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA39143E7B; Sun, 20 Oct 2002 11:20:43 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9KIKfpk075295; Sun, 20 Oct 2002 12:20:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Oct 2002 12:20:29 -0600 (MDT) Message-Id: <20021020.122029.53328411.imp@bsdimp.com> To: dillon@apollo.backplane.com Cc: phk@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: [src] cvs commit: src/sys/i386/pci pci_bus.c From: "M. Warner Losh" In-Reply-To: <200210201746.g9KHk34e033350@apollo.backplane.com> References: <20021020172212.C1EE937B493@hub.freebsd.org> <200210201746.g9KHk34e033350@apollo.backplane.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <200210201746.g9KHk34e033350@apollo.backplane.com> Matthew Dillon writes: : Not so. The -1 is promoted to unsigned for the : comparison. The code may be ugly and need a cast : to br proper, but the condition can in fact return : true here. I recommend you back this out or that : you audit the nexus_pcib_read_config() code to ensure : that it cannot return the equivalent of -1 unsigned. : I suspect that it can in fact return -1. : : id = nexus_pcib_read_config(0, bus, slot, func, : : PCIR_DEVVENDOR, 4); : :- if (id == -1) : :- continue; I susepct the right fix is: if (id == 0xffffffff) continue; Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message