diff options
author | 2005-10-02 14:01:52 +0000 | |
---|---|---|
committer | 2005-10-02 14:01:52 +0000 | |
commit | e145520f76dcabe1b82be3d32c91fabf23557276 (patch) | |
tree | 8c7251c313a2468cfb94ffe7cda33d0285c9f918 | |
parent | avoid multiple calls to sc_enable(). cardbus_intr_establish() was called (diff) | |
download | wireguard-openbsd-e145520f76dcabe1b82be3d32c91fabf23557276.tar.xz wireguard-openbsd-e145520f76dcabe1b82be3d32c91fabf23557276.zip |
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) |