From owner-svn-src-all@FreeBSD.ORG Tue Jul 29 22:02:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1671AB5F; Tue, 29 Jul 2014 22:02:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD9592B80; Tue, 29 Jul 2014 22:02:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6TM2S4w090790; Tue, 29 Jul 2014 22:02:28 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TM2SG6090783; Tue, 29 Jul 2014 22:02:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407292202.s6TM2SG6090783@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 29 Jul 2014 22:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r269268 - stable/8/sys/dev/usb/wlan X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Tue, 29 Jul 2014 22:02:29 -0000 Author: hselasky Date: Tue Jul 29 22:02:27 2014 New Revision: 269268 URL: http://svnweb.freebsd.org/changeset/base/269268 Log: MFC r269127: Fix for division by zero. Modified: stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/dev/usb/wlan/if_zydreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Tue Jul 29 22:00:54 2014 (r269267) +++ stable/8/sys/dev/usb/wlan/if_rum.c Tue Jul 29 22:02:27 2014 (r269268) @@ -1019,6 +1019,8 @@ rum_setup_tx_desc(struct rum_softc *sc, desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Tue Jul 29 22:00:54 2014 (r269267) +++ stable/8/sys/dev/usb/wlan/if_ural.c Tue Jul 29 22:02:27 2014 (r269268) @@ -1022,6 +1022,8 @@ ural_setup_tx_desc(struct ural_softc *sc desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: stable/8/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zyd.c Tue Jul 29 22:00:54 2014 (r269267) +++ stable/8/sys/dev/usb/wlan/if_zyd.c Tue Jul 29 22:02:27 2014 (r269268) @@ -2457,7 +2457,7 @@ zyd_tx_start(struct zyd_softc *sc, struc const struct ieee80211_txparam *tp; struct ieee80211_key *k; int rate, totlen; - static uint8_t ratediv[] = ZYD_TX_RATEDIV; + static const uint8_t ratediv[] = ZYD_TX_RATEDIV; uint8_t phy; uint16_t pktlen; uint32_t bits; Modified: stable/8/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zydreg.h Tue Jul 29 22:00:54 2014 (r269267) +++ stable/8/sys/dev/usb/wlan/if_zydreg.h Tue Jul 29 22:02:27 2014 (r269268) @@ -970,7 +970,7 @@ #define ZYD_TX_RATEDIV \ { \ - 0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6, \ + 0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6, \ 0x36, 0x24, 0x12, 0x9 \ }