NetBSD Problem Report #50792
From www@NetBSD.org Fri Feb 12 16:27:08 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id D085D7ABF2
for <gnats-bugs@gnats.NetBSD.org>; Fri, 12 Feb 2016 16:27:08 +0000 (UTC)
Message-Id: <20160212162707.C71E87ACBD@mollari.NetBSD.org>
Date: Fri, 12 Feb 2016 16:27:07 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/arch/mvme68k/mvme68k/machdep.c:316]: (error) Division by zero.
X-Send-Pr-Version: www-1.0
>Number: 50792
>Category: port-mvme68k
>Synopsis: src/sys/arch/mvme68k/mvme68k/machdep.c:316]: (error) Division by zero.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-mvme68k-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 12 16:30:00 +0000 2016
>Closed-Date: Tue May 31 03:54:10 +0000 2016
>Last-Modified: Tue May 31 03:54:10 +0000 2016
>Originator: David Binderman
>Release: cvs dated 20160212
>Organization:
>Environment:
>Description:
Source code is
/* calculate cpuspeed */
cpuspeed = 8192 / delay_divisor;
cpuspeed *= 100;
There is no belt'n'braces code to ensure delay_divisor != 0.
Suggest add some.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/50792 CVS commit: src/sys/arch/mvme68k/mvme68k
Date: Tue, 31 May 2016 03:25:46 +0000
Module Name: src
Committed By: dholland
Date: Tue May 31 03:25:46 UTC 2016
Modified Files:
src/sys/arch/mvme68k/mvme68k: machdep.c
Log Message:
PR 50792 David Binderman: make sure we don't divide by zero.
The loop that picks delay_divisor might conceivably reject all values,
particularly if the hardware is sulking for some reason; in that case
it'll be left zero. Use 1 instead of 0 so we don't then crash.
To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/arch/mvme68k/mvme68k/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 31 May 2016 03:54:10 +0000
State-Changed-Why:
fixed, thanks
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.