From owner-freebsd-bugs Wed Apr 22 07:08:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA17875 for freebsd-bugs-outgoing; Wed, 22 Apr 1998 07:08:30 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from miller.cs.uwm.edu (miller.cs.uwm.edu [129.89.139.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA17841 for ; Wed, 22 Apr 1998 14:08:24 GMT (envelope-from james@miller.cs.uwm.edu) Received: (from james@localhost) by miller.cs.uwm.edu (8.8.5/8.8.5) id JAA07541; Wed, 22 Apr 1998 09:08:13 -0500 (CDT) Date: Wed, 22 Apr 1998 09:08:13 -0500 (CDT) From: Jim Lowe Message-Id: <199804221408.JAA07541@miller.cs.uwm.edu> To: freebsd-bugs@FreeBSD.ORG Subject: PCI attach of if_ed.c & if_lnc.c Cc: jwd@unx.sas.com Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I was having some trouble with attaching PCI versions of the Lance ethernet driver (it is crashing my system). I looked at the code and in if_lnc.c and there seems to be a problem. A similar problem exists in the if_ed.c driver. In the ed_attach_NE2000_pci and the lnc_attach_ne2100_pci routines there is some code which reads: if_lnc.c: struct lnc_softc *sc = malloc(sizeof *sc, M_DEVBUF, M_NOWAIT); if (sc) bzero(sc, sizeof *sc); [...] if_ed.c: struct ed_softc *sc = malloc(sizeof *sc, M_DEVBUF, M_NOWAIT); [...] bzero(sc, sizeof *sc); Shouldn't these routines be allocating and clearing the softc structure and not a pointer to the softc structure as below? if_lnc.c: struct lnc_softc *sc = malloc(sizeof sc, M_DEVBUF, M_NOWAIT); if (sc) bzero(sc, sizeof sc); [...] if_ed.c: struct ed_softc *sc = malloc(sizeof sc, M_DEVBUF, M_NOWAIT); [...] bzero(sc, sizeof sc); Thanks for taking the time to look into this. -Jim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message