[IrDA]: Fix Rx/Tx path race.

From: G. Liakhovetski <gl@dsa-ac.de>

We need to switch to NRM _before_ sending the final packet otherwise
we might hit a race condition where we get the first packet from the
peer while we're still in LAP_XMIT_P.

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
G. Liakhovetski
2007-06-08 19:15:17 -07:00
committed by David S. Miller
parent 81d84a94be
commit c0cfe7faa1
3 changed files with 20 additions and 18 deletions

View File

@@ -289,4 +289,21 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self)
self->disconnect_pending = FALSE;
}
/*
* Function irlap_next_state (self, state)
*
* Switches state and provides debug information
*
*/
static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
{
/*
if (!self || self->magic != LAP_MAGIC)
return;
IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
*/
self->state = state;
}
#endif