]> err.no Git - linux-2.6/blobdiff - net/irda/irda_device.c
[NETFILTER]: CLUSTERIP: fix memcpy() length typo
[linux-2.6] / net / irda / irda_device.c
index fda299e300c08f857e57e2b18c231afb23a5301f..70543d89438b8d7b4007b26102e8b11ca484e6a3 100644 (file)
@@ -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;
@@ -463,11 +470,11 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle)
 }
 EXPORT_SYMBOL(irda_device_unregister_dongle);
 
-#ifdef CONFIG_ISA
+#ifdef CONFIG_ISA_DMA_API
 /*
  * Function setup_dma (idev, buffer, count, mode)
  *
- *    Setup the DMA channel. Commonly used by ISA FIR drivers
+ *    Setup the DMA channel. Commonly used by LPC FIR drivers
  *
  */
 void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode)