diff options
author | Jean Tourrilhes <jt@hpl.hp.com> | 2005-04-17 02:24:11 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 02:24:11 +0400 |
commit | 7e5c6bc0a600c49e5922591ad41ff41987f54eb4 (patch) | |
tree | 5855fa231cff77adeed4838757116d1948cb97cb /net/irda/irda_device.c | |
parent | 6775cab98b89b2caa10dce4b07e2c81999e45517 (diff) | |
download | linux-7e5c6bc0a600c49e5922591ad41ff41987f54eb4.tar.xz |
[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/irda_device.c')
-rw-r--r-- | net/irda/irda_device.c | 11 |
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) self = (struct irlap_cb *) dev->atalk_ptr; - IRDA_ASSERT(self != NULL, return;); - IRDA_ASSERT(self->magic == LAP_MAGIC, return;); + /* Some drivers may enable the receive interrupt before calling + * irlap_open(), or they may disable the receive interrupt + * after calling irlap_close(). + * The IrDA stack is protected from this in irlap_driver_rcv(). + * However, the driver calls directly the wrapper, that calls + * us directly. Make sure we protect ourselves. + * Jean II */ + if (!self || self->magic != LAP_MAGIC) + return; if (status) { self->media_busy = TRUE; |