From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 7 16:00:17 2010 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 AFC081065672 for ; Mon, 7 Jun 2010 16:00:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 73DD68FC17 for ; Mon, 7 Jun 2010 16:00:17 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o57G0HGB062540 for ; Mon, 7 Jun 2010 16:00:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o57G0Hae062539; Mon, 7 Jun 2010 16:00:17 GMT (envelope-from gnats) Resent-Date: Mon, 7 Jun 2010 16:00:17 GMT Resent-Message-Id: <201006071600.o57G0Hae062539@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39A01065677 for ; Mon, 7 Jun 2010 15:50:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C2A928FC1F for ; Mon, 7 Jun 2010 15:50:54 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Fosgk039015 for ; Mon, 7 Jun 2010 15:50:54 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o57Fosb9039014; Mon, 7 Jun 2010 15:50:54 GMT (envelope-from nobody) Message-Id: <201006071550.o57Fosb9039014@www.freebsd.org> Date: Mon, 7 Jun 2010 15:50:54 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/147654: [patch] fix unitialized mfi_unit value passed to mfiutil(8) / mptutil(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 16:00:17 -0000 >Number: 147654 >Category: bin >Synopsis: [patch] fix unitialized mfi_unit value passed to mfiutil(8) / mptutil(8) >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: Mon Jun 07 16:00:17 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9-CURRENT >Organization: Cisco Systems, Inc. >Environment: FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206173M: Mon Apr 26 22:45:06 PDT 2010 root@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA.ata amd64 >Description: The value of mpt_unit can be undefined (depending on how the stack is allocated) if -u isn't passed to the command. This patch explicitly notes that the default mpt_unit is unit 0 in both mfiutil(8) and mptutil(8). >How-To-Repeat: >Fix: Patch attached with submission follows: Index: mfiutil/mfiutil.c =================================================================== --- mfiutil/mfiutil.c (revision 206173) +++ mfiutil/mfiutil.c (working copy) @@ -43,7 +43,7 @@ MFI_TABLE(top, stop); MFI_TABLE(top, abort); -int mfi_unit; +int mfi_unit = 0; static void usage(void) Index: mptutil/mptutil.c =================================================================== --- mptutil/mptutil.c (revision 206173) +++ mptutil/mptutil.c (working copy) @@ -42,7 +42,7 @@ SET_DECLARE(MPT_DATASET(top), struct mptutil_command); -int mpt_unit; +int mpt_unit = 0; static void usage(void) >Release-Note: >Audit-Trail: >Unformatted: