ref: a8f69d4a0d1e9478b8466f09d35ab193d5f509c7
parent: 43f327485d374db949b9d83816c186371bbe4420
author: aiju <[email protected]>
date: Fri Jul 22 07:25:44 EDT 2011
etherbcm: another try at the memleak
--- a/sys/src/9/pc/etherbcm.c
+++ b/sys/src/9/pc/etherbcm.c
@@ -358,18 +358,16 @@
print("bcm: send queue full\n");
break;
}
- if(incr == ctlr->sendcleani) {
- bcmtransclean(edev, 0);
- if(incr == ctlr->sendcleani)
- break;
- }
bp = qget(edev->oq);
if(bp == nil) break;
+ setmalloctag(bp, (ulong)(void*)bcmtransmit);
next = ctlr->sendr + ctlr->sendri * 4;
next[0] = 0;
next[1] = PADDR(bp->rp);
next[2] = (BLEN(bp) << 16) | PacketEnd;
next[3] = 0;
+ if(ctlr->sends[ctlr->sendri] != 0)
+ freeb(ctlr->sends[ctlr->sendri]);
ctlr->sends[ctlr->sendri] = bp;
csr32(ctlr, SendBDRingHostIndex) = ctlr->sendri = incr;
}