From 5ac42f797bbfa4cd4d40a72a050d90f1207a9ef8 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 8 Mar 2007 18:50:58 +0000 Subject: XXX commit a workaround (as found in a few other drivers) for the divide by zero rate bug. Someone has to find the source of this bug one day; from stephen@sock.org.uk, ok niallo --- sys/dev/ic/rt2661.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic/rt2661.c') diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index d7fa264e9da..b0ebe1c8d0a 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.35 2007/01/03 18:16:43 claudio Exp $ */ +/* $OpenBSD: rt2661.c,v 1.36 2007/03/08 18:50:57 deraadt Exp $ */ /*- * Copyright (c) 2006 @@ -1576,6 +1576,8 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0, rs_rates[ic->ic_fixed_rate]; } else rate = ni->ni_rates.rs_rates[ni->ni_txrate]; + if (rate == 0) + rate = 2; /* XXX should not happen */ rate &= IEEE80211_RATE_VAL; /* -- cgit v1.2.3