tree e48b82973fb4fd292d0cd6141a514950245ab5b1
parent 769a510e4098689d708a804a5ee7bce5ca0994ab
author Jean Tourrilhes <[EMAIL PROTECTED]> Tue Apr 12 08:24:47 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:24:47 2005

[PATCH] irda_device() oops fix

Acked-by: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 irda_device.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Index: net/irda/irda_device.c
===================================================================
--- 3db1367cfcf4884170ac0b7205d155c807c6bc72/net/irda/irda_device.c  
(mode:100644 sha1:6d29b34d5d9b7d2b8e55b4324faedc7f8a885f63)
+++ e48b82973fb4fd292d0cd6141a514950245ab5b1/net/irda/irda_device.c  
(mode:100644 sha1:0dd0d6ccb3b5365dd4bcbc0c92d9d8a3b319628a)
@@ -125,8 +125,15 @@
 
        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;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to