From owner-svn-src-head@freebsd.org Tue Dec 3 17:43:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F6981B73B8; Tue, 3 Dec 2019 17:43:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47S8VK3cD7z3Cgp; Tue, 3 Dec 2019 17:43:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FCE81B515; Tue, 3 Dec 2019 17:43:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB3HhrX2025340; Tue, 3 Dec 2019 17:43:53 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB3HhrVN025339; Tue, 3 Dec 2019 17:43:53 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912031743.xB3HhrVN025339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 3 Dec 2019 17:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355343 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 355343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2019 17:43:53 -0000 Author: rlibby Date: Tue Dec 3 17:43:52 2019 New Revision: 355343 URL: https://svnweb.freebsd.org/changeset/base/355343 Log: mips busdma: bzero map on alloc Maps from the mips busdma dmamap_zone were not completely initialized. In particular, pagesneeded and pagesreserved were not initialized. This could cause a crash. Remove some dead fields from mips struct bus_dmamap while here. Reported by: brooks Reviewed by: ian Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22638 Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Tue Dec 3 17:06:48 2019 (r355342) +++ head/sys/mips/mips/busdma_machdep.c Tue Dec 3 17:43:52 2019 (r355343) @@ -156,8 +156,6 @@ struct bus_dmamap { bus_dma_tag_t dmat; struct memdesc mem; int flags; - void *origbuffer; - void *allocbuffer; TAILQ_ENTRY(bus_dmamap) freelist; STAILQ_ENTRY(bus_dmamap) links; bus_dmamap_callback_t *callback; @@ -205,11 +203,8 @@ dmamap_ctor(void *mem, int size, void *arg, int flags) dmat->map_count++; + bzero(map, sizeof(*map)); map->dmat = dmat; - map->flags = 0; - map->slist = NULL; - map->allocbuffer = NULL; - map->sync_count = 0; STAILQ_INIT(&map->bpages); return (0);