From owner-svn-src-all@FreeBSD.ORG Fri Aug 8 14:48:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71D93195 for ; Fri, 8 Aug 2014 14:48:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47B8F2B87 for ; Fri, 8 Aug 2014 14:48:27 +0000 (UTC) Received: from joerg (uid 548) (envelope-from joerg@FreeBSD.org) id 2fd8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 14:48:27 +0000 From: Joerg Wunsch Date: Fri, 8 Aug 2014 14:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269718 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4e33b.2fd8.1842af28@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 14:48:27 -0000 Author: joerg Date: Fri Aug 8 14:48:26 2014 New Revision: 269718 URL: http://svnweb.freebsd.org/changeset/base/269718 Log: Merge r269470: Avoid a divide-by-zero panic when setting the baudrate to 0. Modified: stable/10/sys/dev/usb/serial/umcs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/umcs.c ============================================================================== --- stable/10/sys/dev/usb/serial/umcs.c Fri Aug 8 14:42:03 2014 (r269717) +++ stable/10/sys/dev/usb/serial/umcs.c Fri Aug 8 14:48:26 2014 (r269718) @@ -1083,7 +1083,10 @@ umcs7840_calc_baudrate(uint32_t rate, ui for (i = 0; i < umcs7840_baudrate_divisors_len - 1 && !(rate > umcs7840_baudrate_divisors[i] && rate <= umcs7840_baudrate_divisors[i + 1]); ++i); - *divisor = umcs7840_baudrate_divisors[i + 1] / rate; + if (rate == 0) + *divisor = 1; /* XXX */ + else + *divisor = umcs7840_baudrate_divisors[i + 1] / rate; /* 0x00 .. 0x70 */ *clk = i << MCS7840_DEV_SPx_CLOCK_SHIFT; return (0);