From 26132c6d273f2ff10a6d482c8c42a14457abef46 Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Sun, 2 Oct 2005 14:01:53 +0000 Subject: assert tx rate is non-null so we don't end up dividing by zero. --- sys/dev/ic/ral.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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) -- cgit v1.2.3