From 661dac1598183f13d83435aa2f8ccf317284a055 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 16 Feb 2015 03:34:35 -0500 Subject: dev: Fix undefined behaviuor in i8254xGBe This patch fixes a rather unfortunate oversight where the annotation pointer was used even though it is null. Somehow the code still works, but UBSan is rather unhappy. The use is now guarded, and the variable is initialised in the constructor (as well as init()). --- src/dev/i8254xGBe.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dev/i8254xGBe.cc') diff --git a/src/dev/i8254xGBe.cc b/src/dev/i8254xGBe.cc index 70dba7c22..213ad580a 100644 --- a/src/dev/i8254xGBe.cc +++ b/src/dev/i8254xGBe.cc @@ -58,7 +58,7 @@ using namespace iGbReg; using namespace Net; IGbE::IGbE(const Params *p) - : EtherDevice(p), etherInt(NULL), drainManager(NULL), + : EtherDevice(p), etherInt(NULL), cpa(NULL), drainManager(NULL), rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size), rxTick(false), txTick(false), txFifoTick(false), rxDmaPacket(false), pktOffset(0), fetchDelay(p->fetch_delay), wbDelay(p->wb_delay), @@ -2390,7 +2390,7 @@ IGbE::txWire() anPq("TXQ", "TX FIFO Q"); if (etherInt->sendPacket(txFifo.front())) { - cpa->hwQ(CPA::FL_NONE, sys, macAddr, "TXQ", "WireQ", 0); + anQ("TXQ", "WireQ"); if (DTRACE(EthernetSM)) { IpPtr ip(txFifo.front()); if (ip) -- cgit v1.2.3