lkml.org 
[lkml]   [2005]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 023/198] irda_device() oops fix
From
Date

From: Jean Tourrilhes <jt@hpl.hp.com>

Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

25-akpm/net/irda/irda_device.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff -puN net/irda/irda_device.c~irda_device-oops-fix net/irda/irda_device.c
--- 25/net/irda/irda_device.c~irda_device-oops-fix 2005-04-12 03:21:08.744807488 -0700
+++ 25-akpm/net/irda/irda_device.c 2005-04-12 03:21:08.747807032 -0700
@@ -125,8 +125,15 @@ void irda_device_set_media_busy(struct n

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 linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-04-12 14:42    [W:0.047 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site