summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-08-12 14:09:47 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-08-12 14:09:47 +0000
commitc12e3d638d1ad3c3474c067818de398dd6a70f36 (patch)
treee9b972fc86a1a91ed12a771a8436d2a723531166 /sys
parent210230f453de19426eadecfec5a35afdf939db98 (diff)
Fix Coverity CID 1453237: With rt2661 chips ral(4) was writing some stack
memory garbage to the hardware while setting up beacon transmission. The driver left some fields of a struct rt2661_tx_desc on stack uninitialized. Zero out the entire struct before using it. ok mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/rt2661.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index b88aee1af20..7350385b935 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.92 2017/07/03 09:21:09 kevlo Exp $ */
+/* $OpenBSD: rt2661.c,v 1.93 2017/08/12 14:09:46 stsp Exp $ */
/*-
* Copyright (c) 2006
@@ -2938,6 +2938,7 @@ rt2661_prepare_beacon(struct rt2661_softc *sc)
/* send beacons at the lowest available rate */
rate = IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) ? 12 : 2;
+ memset(&desc, 0, sizeof(desc));
rt2661_setup_tx_desc(sc, &desc, RT2661_TX_TIMESTAMP, RT2661_TX_HWSEQ,
m0->m_pkthdr.len, rate, NULL, 0, RT2661_QID_MGT,
RT2661_AMRR_INVALID_ID);