aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda
diff options
context:
space:
mode:
authorJean Tourrilhes <jt@hpl.hp.com>2005-04-16 18:24:11 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:24:11 -0400
commit7e5c6bc0a600c49e5922591ad41ff41987f54eb4 (patch)
tree5855fa231cff77adeed4838757116d1948cb97cb /net/irda
parent6775cab98b89b2caa10dce4b07e2c81999e45517 (diff)
[PATCH] irda_device() oops fix
Acked-by: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/irda')
-rw-r--r--net/irda/irda_device.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index fda299e300c0..9b9bb003c5a9 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -125,8 +125,15 @@ void irda_device_set_media_busy(struct net_device *dev, int status)
125 125
126 self = (struct irlap_cb *) dev->atalk_ptr; 126 self = (struct irlap_cb *) dev->atalk_ptr;
127 127
128 IRDA_ASSERT(self != NULL, return;); 128 /* Some drivers may enable the receive interrupt before calling
129 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 129 * irlap_open(), or they may disable the receive interrupt
130 * after calling irlap_close().
131 * The IrDA stack is protected from this in irlap_driver_rcv().
132 * However, the driver calls directly the wrapper, that calls
133 * us directly. Make sure we protect ourselves.
134 * Jean II */
135 if (!self || self->magic != LAP_MAGIC)
136 return;
130 137
131 if (status) { 138 if (status) {
132 self->media_busy = TRUE; 139 self->media_busy = TRUE;