diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2005-10-02 14:01:53 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2005-10-02 14:01:53 +0000 |
commit | 26132c6d273f2ff10a6d482c8c42a14457abef46 (patch) | |
tree | 12961801c5d81403a879b70e211a05bf2348487a | |
parent | 5664c3e79ee33a697cde57a4aefe607e2d8e58a9 (diff) |
assert tx rate is non-null so we don't end up dividing by zero.
-rw-r--r-- | sys/dev/ic/ral.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ic/ral.c b/sys/dev/ic/ral.c index a2509a520e7..fa03c9699fb 100644 --- a/sys/dev/ic/ral.c +++ b/sys/dev/ic/ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ral.c,v 1.61 2005/10/02 13:50:29 damien Exp $ */ +/* $OpenBSD: ral.c,v 1.62 2005/10/02 14:01:52 damien Exp $ */ /*- * Copyright (c) 2005 @@ -1820,6 +1820,9 @@ ral_tx_data(struct ral_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) } rate &= IEEE80211_RATE_VAL; + /* assert tx rate is non-null so we don't end up dividing by zero */ + KASSERT(rate != 0); + if (ic->ic_flags & IEEE80211_F_WEPON) { m0 = ieee80211_wep_crypt(ifp, m0, 1); if (m0 == NULL) |