From owner-freebsd-bugs Sat Oct 21 7:20:11 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BC97837B4C5 for ; Sat, 21 Oct 2000 07:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA76496; Sat, 21 Oct 2000 07:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from mail.snickers.org (snickers.org [216.126.90.2]) by hub.freebsd.org (Postfix) with ESMTP id 0FDAE37B479; Sat, 21 Oct 2000 07:17:53 -0700 (PDT) Received: by mail.snickers.org (Postfix, from userid 1037) id 5923E3D1D; Sat, 21 Oct 2000 10:17:52 -0400 (EDT) Message-Id: <20001021141752.5923E3D1D@mail.snickers.org> Date: Sat, 21 Oct 2000 10:17:52 -0400 (EDT) From: josh@zipperup.org Reply-To: josh@zipperup.org To: FreeBSD-gnats-submit@freebsd.org Cc: dwmalone@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/22188: Patch to sys/alpha to add M_ZERO to appropriate malloc calls Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22188 >Category: kern >Synopsis: Patch to sys/alpha to add M_ZERO to appropriate malloc calls >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Oct 21 07:20:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Josh Tiefenbach >Release: FreeBSD 5.0-CURRENT i386 >Organization: Connective Software >Environment: -current circa 20 Oct 2000 >Description: Patch to convert malloc/bzero calls to malloc(..., M_ZERO) calls, as per phk's email to freebsd-current. Changes were made with the goal of keeping the semantics of the code the same in mind. If there was any doubt, then the change was not made. The patch compiles cleanly. Note, I dont have an alpha, so I'm not sure if everything is hunky-dory. >How-To-Repeat: N/A >Fix: Patch follows. ------- Index: alpha/interrupt.c =================================================================== RCS file: /usr/home/ncvs/src/sys/alpha/alpha/interrupt.c,v retrieving revision 1.24 diff -u -r1.24 interrupt.c --- alpha/interrupt.c 2000/10/05 23:09:42 1.24 +++ alpha/interrupt.c 2000/10/21 14:11:26 @@ -371,11 +371,10 @@ if (ithd == NULL || ithd->it_ih == NULL) { /* first handler for this vector */ if (ithd == NULL) { - ithd = malloc(sizeof(struct ithd), M_DEVBUF, M_WAITOK); + ithd = malloc(sizeof(struct ithd), M_DEVBUF, M_WAITOK | M_ZERO); if (ithd == NULL) return ENOMEM; - bzero(ithd, sizeof(struct ithd)); ithd->irq = vector; ithd->it_md = i; i->ithd = ithd; @@ -410,10 +409,9 @@ } /* Third, setup the interrupt descriptor for this handler. */ - idesc = malloc(sizeof (struct intrec), M_DEVBUF, M_WAITOK); + idesc = malloc(sizeof (struct intrec), M_DEVBUF, M_WAITOK | M_ZERO); if (idesc == NULL) return ENOMEM; - bzero(idesc, sizeof(struct intrec)); idesc->handler = handler; idesc->argument = arg; Index: osf1/imgact_osf1.c =================================================================== RCS file: /usr/home/ncvs/src/sys/alpha/osf1/imgact_osf1.c,v retrieving revision 1.1 diff -u -r1.1 imgact_osf1.c --- osf1/imgact_osf1.c 1999/12/14 22:35:32 1.1 +++ osf1/imgact_osf1.c 2000/10/21 14:12:02 @@ -109,8 +109,7 @@ printf("unknown ecoff magic %x\n", eap->magic); return ENOEXEC; } - osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_WAITOK); - bzero(osf_auxargs, sizeof(Osf_Auxargs)); + osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_WAITOK | M_ZERO); imgp->auxargs = osf_auxargs; osf_auxargs->executable = osf_auxargs->exec_path; path_not_saved = copyinstr(imgp->fname, osf_auxargs->executable, @@ -226,8 +225,7 @@ raw_dend = (eap->data_start + eap->dsize); if (dend > raw_dend) { caddr_t zeros; - zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK); - bzero(zeros,dend-raw_dend); + zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK|M_ZERO); if ((error = copyout(zeros, (caddr_t)raw_dend, dend-raw_dend))) { uprintf("Can't zero start of bss, error %d\n",error); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message