From owner-freebsd-arm@FreeBSD.ORG Tue May 15 01:09:10 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66F7816A403 for ; Tue, 15 May 2007 01:09:10 +0000 (UTC) (envelope-from fate10@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.224]) by mx1.freebsd.org (Postfix) with ESMTP id 29F2213C455 for ; Tue, 15 May 2007 01:09:10 +0000 (UTC) (envelope-from fate10@gmail.com) Received: by nz-out-0506.google.com with SMTP id s1so2112101nze for ; Mon, 14 May 2007 18:09:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Thu3oUbbmXUJfaAFOn0eh0t+3CeJFVyNIY5QDZSWyjEICqW8N12GrC8dqNGbtLfEpnnsp50FmYqyNcDD2MaA9RBYMhX188J4HDWtHcDq2cw6boRM5AOeTepwOhQ4f2O8oy/s7MoRFL3lzITAvNyv7MhoSnJ/WeggQBjg4aJeX9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CEK8D1seqooMtnFtl3c1n+j7MjohELVg3YbvM9KeI0zAuYiN2FUHZMeMnoCeskc16Xy1cLv/Jo+D3oYGAnOw6SSWwPDuY++V9zKSS4WQTtRG1vorf1HUzmE3IwhdNn75xlVqzL6JOPJ8voULAq2pC8Sg62Ludb6gK0LcTedhgFc= Received: by 10.65.250.11 with SMTP id c11mr11449017qbs.1179189669507; Mon, 14 May 2007 17:41:09 -0700 (PDT) Received: by 10.65.74.5 with HTTP; Mon, 14 May 2007 17:41:09 -0700 (PDT) Message-ID: <7b8b6fbc0705141741n4ee98fateb5ab34a2f307a6c@mail.gmail.com> Date: Tue, 15 May 2007 04:41:09 +0400 From: fate To: freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: missing M_ZERO malloc flag in src/sys/arm/arm/busdma_machdep.c X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2007 01:09:10 -0000 Hi, It would be good to apply this small patch: *** busdma_machdep.c.orig --- busdma_machdep.c *************** *** 345,351 **** if (!parent) parent = arm_root_dma_tag; ! newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, 0, error); --- 345,351 ---- if (!parent) parent = arm_root_dma_tag; ! newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT | M_ZERO); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, 0, error); or the structure newtag would not be initialized correctly in case of dirty memory and failed on this if block: if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) { _busdma_free_dmamap(newmap); *mapp = NULL; return (error); } } left bounce_zone unallocated with kernel crash as result SY, Vladimir Belian