Bug 32666

Summary: mbufs leaks in dev/ed
Product: Base System Reporter: Chi-Fung Fan <chifung>
Component: i386Assignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Chi-Fung Fan 2001-12-10 08:30:00 UTC
When ed0 is connected to a noisy network (e.g. @home network), ed_pio_write_mbufs() frequently fails to "wait for remote DMA complete."
The caller ed_start() doesn't free the mbuf when this happens resulting in mbufs leaks.  This would eventually exhaust all the systems mbufs.

Fix: 

In /usr/src/sys/dev/ed/if_ed.c function ed_start(ifp), add m_freem(m0)
before go back to loop.

len = ed_pio_write_mbufs(sc, m, (int)buffer);
if (len == 0) {
     m_freem(m0);  /* fix mbufs leak */
     goto outloop;
}
How-To-Repeat: connect to a noisy network and make sure you see many of
"ed0: remote transmit DMA failed to complete" messages.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-30 12:22:15 UTC
Responsible Changed
From-To: freebsd-bugs->imp

Warner, you've spent a bit of time in the ed(4) driver -- could you take 
a look at this?
Comment 2 Warner Losh freebsd_committer freebsd_triage 2002-09-30 01:14:16 UTC
State Changed
From-To: open->closed

I've committed this fix.