From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 00:49:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0DB3CAC; Fri, 14 Mar 2014 00:49:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83AC6644; Fri, 14 Mar 2014 00:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E0n24j081320; Fri, 14 Mar 2014 00:49:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E0n2Zp081319; Fri, 14 Mar 2014 00:49:02 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403140049.s2E0n2Zp081319@svn.freebsd.org> From: Ian Lepore Date: Fri, 14 Mar 2014 00:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263124 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 14 Mar 2014 00:49:02 -0000 Author: ian Date: Fri Mar 14 00:49:02 2014 New Revision: 263124 URL: http://svnweb.freebsd.org/changeset/base/263124 Log: Fix an uninitialized variable error I perpetrated when splitting some code into a separate function. Pass the missing value from main() to the probe_disks() function. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Fri Mar 14 00:47:46 2014 (r263123) +++ head/sys/boot/uboot/common/main.c Fri Mar 14 00:49:02 2014 (r263124) @@ -298,9 +298,10 @@ get_load_device(int *type, int *unit, in } static int -probe_disks(int load_type, int load_unit, int load_slice, int load_partition) +probe_disks(int devidx, int load_type, int load_unit, int load_slice, + int load_partition) { - int i, open_result, unit; + int open_result, unit; struct open_file f; currdev.d_disk.slice = load_slice; @@ -317,7 +318,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f, &currdev); + open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); return (0); @@ -337,7 +338,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f, &currdev); + open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); return (0); @@ -351,7 +352,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f,&currdev); + open_result = devsw[devidx]->dv_open(&f,&currdev); if (open_result == 0) { printf("good.\n"); return (0); @@ -440,7 +441,7 @@ main(void) if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { - if (probe_disks(load_type, load_unit, load_slice, + if (probe_disks(i, load_type, load_unit, load_slice, load_partition) == 0) break; }