From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 19 19:50:12 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9909106566B for ; Thu, 19 Jan 2012 19:50:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B914A8FC12 for ; Thu, 19 Jan 2012 19:50:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0JJoCjb060459 for ; Thu, 19 Jan 2012 19:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0JJoC3P060458; Thu, 19 Jan 2012 19:50:12 GMT (envelope-from gnats) Date: Thu, 19 Jan 2012 19:50:12 GMT Message-Id: <201201191950.q0JJoC3P060458@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Cc: Subject: Re: kern/164313: Fix pci_get_vpd_readonly_method X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 19:50:12 -0000 The following reply was made to PR kern/164313; it has been noted by GNATS. From: John Baldwin To: bug-followup@FreeBSD.org, chuck@tuffli.net Cc: Subject: Re: kern/164313: Fix pci_get_vpd_readonly_method Date: Thu, 19 Jan 2012 14:41:45 -0500 Huh. Might be even simpler to just return instead of breaking out of the loop once vptr is found. Index: pci.c =================================================================== --- pci.c (revision 230331) +++ pci.c (working copy) @@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev, device_t if (memcmp(kw, cfg->vpd.vpd_ros[i].keyword, sizeof(cfg->vpd.vpd_ros[i].keyword)) == 0) { *vptr = cfg->vpd.vpd_ros[i].value; + return (0); } - if (i != cfg->vpd.vpd_rocnt) - return (0); - *vptr = NULL; return (ENXIO); } Does this work for you as well? -- John Baldwin