From owner-freebsd-current@FreeBSD.ORG Sun Jul 31 17:13:22 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1551B16A41F for ; Sun, 31 Jul 2005 17:13:22 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDB4B43D53 for ; Sun, 31 Jul 2005 17:13:21 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.93] ([66.127.85.93]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j6VHDKms098242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Jul 2005 10:13:21 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <42ED06D8.70506@errno.com> Date: Sun, 31 Jul 2005 10:14:00 -0700 From: Sam Leffler Organization: Errno Consulting User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christian Brueffer References: <20050731142625.GC1190@unixpages.org> In-Reply-To: <20050731142625.GC1190@unixpages.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: current@freebsd.org Subject: Re: [PATCH] fwip(4) panic on attach X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2005 17:13:22 -0000 Christian Brueffer wrote: > Hi, > > in CURRENT and RELENG_6 I get a reproducible panic with fwip(4) when > plugging in my firewire cardbus card. The following patch fixes it, > but I'm not sure if it's correct. > > The interface works after applying the patch. > > Index: if_fwip.c > =================================================================== > RCS file: /data/ncvs/freebsd/src/sys/dev/firewire/if_fwip.c,v > retrieving revision 1.7 > diff -u -r1.7 if_fwip.c > --- if_fwip.c 10 Jun 2005 16:49:08 -0000 1.7 > +++ if_fwip.c 31 Jul 2005 14:01:52 -0000 > @@ -171,11 +171,13 @@ > > fwip = ((struct fwip_softc *)device_get_softc(dev)); > unit = device_get_unit(dev); > + > + bzero(fwip, sizeof(struct fwip_softc)); > + > ifp = fwip->fw_softc.fwip_ifp = if_alloc(IFT_IEEE1394); > if (ifp == NULL) > return (ENOSPC); > > - bzero(fwip, sizeof(struct fwip_softc)); > /* XXX */ > fwip->dma_ch = -1; > I thought the softc was guaranteed to be zero'd; can't you just delete the bzero? Sam