From owner-freebsd-hackers Mon Apr 15 9:11: 5 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 5171A37B404; Mon, 15 Apr 2002 09:11:00 -0700 (PDT) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.12.2/8.12.2) with ESMTP id g3FGArcQ056544; Mon, 15 Apr 2002 09:10:53 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.12.2/8.12.2) with ESMTP id g3FGAZBa020561; Mon, 15 Apr 2002 09:10:35 -0700 (PDT) (envelope-from frank@realtime.exit.com) Received: (from frank@localhost) by realtime.exit.com (8.12.2/8.12.2/Submit) id g3FGAZXp020560; Mon, 15 Apr 2002 09:10:35 -0700 (PDT) From: Frank Mayhar Message-Id: <200204151610.g3FGAZXp020560@realtime.exit.com> Subject: Re: Minor weirdness in pci/agp_amd.c. In-Reply-To: <200204151535.g3FFZgEv014359@realtime.exit.com> To: Coleman Kane Date: Mon, 15 Apr 2002 09:10:35 -0700 (PDT) Cc: hackers@FreeBSD.org Reply-To: frank@exit.com Organization: Exit Consulting X-Copyright0: Copyright 2002 Frank Mayhar. All Rights Reserved. X-Copyright1: Permission granted for electronic reproduction as Usenet News or email only. X-Mailer: ELM [version 2.4ME+ PL95a (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Well, I updated my tree (4.5-stable again) and was going through agp_amd.c to check out the changes, when another gotcha jumped out at me. At line 113 you allocate the ag_vdir, then bzero it: /* * Allocate the page directory. */ gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); bzero(gatt->ag_vdir, AGP_PAGE_SIZE); if (!gatt->ag_vdir) { Looks to me like if the malloc fails the bzero will trap, eh? The bzero() should be after the "if (!gatt->ag_vdir)" test. An extra set of eyes can always be useful, I guess. :-) -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message