X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Firda%2Firda_device.c;h=70543d89438b8d7b4007b26102e8b11ca484e6a3;hb=975f957dc408925805dd8f5aa4217b7eeea2d005;hp=fda299e300c08f857e57e2b18c231afb23a5301f;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index fda299e300..70543d8943 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; @@ -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)