fix condition to check if a midi port is referenced

This commit is contained in:
Alexandre Ratchov 2013-09-28 20:44:50 +02:00
parent 5f8c1c9420
commit 075b3da909
1 changed files with 2 additions and 1 deletions

View File

@ -492,7 +492,8 @@ port_unref(struct port *c)
#endif
for (rxmask = 0, i = 0; i < MIDI_NEP; i++)
rxmask |= midi_ep[i].txmask;
if ((rxmask & ~c->midi->self) == 0 && c->state == PORT_INIT && !c->hold)
if ((rxmask & c->midi->self) == 0 && c->midi->txmask == 0 &&
c->state == PORT_INIT && !c->hold)
port_drain(c);
}