tree 5855fa231cff77adeed4838757116d1948cb97cb
parent 6775cab98b89b2caa10dce4b07e2c81999e45517
author Jean Tourrilhes <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:11 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:11 -0700

[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/irda_device.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Index: net/irda/irda_device.c
===================================================================
--- c24ede63d9f2eb303744d5c96c8f5294cee3c1db/net/irda/irda_device.c  
(mode:100644 sha1:fda299e300c08f857e57e2b18c231afb23a5301f)
+++ 5855fa231cff77adeed4838757116d1948cb97cb/net/irda/irda_device.c  
(mode:100644 sha1:9b9bb003c5a9f8c49599151202a13db7396b5493)
@@ -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