[PATCH] fix pcmcia_device_remove oops

Hugh Dickins hugh at veritas.com
Wed Apr 5 08:44:55 EDT 2006


On Tue, 4 Apr 2006, Dominik Brodowski wrote:
> 
> Does this patch help?

It sure does: removal then insertion both fine now: thanks a lot!
Hugh

> Thanks,
> 	Dominik
> 
> 
> From: Dominik Brodowski <linux at dominikbrodowski.net>
> Date: Tue Apr 4 11:09:26 2006 +0200
> Subject: [PATCH] pcmcia: do not set dev_node to NULL too early
> 
> If we set dev_node to NULL too early, some drivers which used this to
> determine whether unregister_netdev() needs to be called fail when removing
> a PCMCIA card.
> 
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> 
> ---
> 
>  drivers/pcmcia/ds.c              |    2 ++
>  drivers/pcmcia/pcmcia_resource.c |    2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> 0d549e7fbed295d9530f5529ec8f4c3b32cfa822
> diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
> index 7b7428c..0f98cab 100644
> --- a/drivers/pcmcia/ds.c
> +++ b/drivers/pcmcia/ds.c
> @@ -476,6 +476,8 @@ static int pcmcia_device_remove(struct d
>  	if (p_drv->remove)
>  	       	p_drv->remove(p_dev);
>  
> +	p_dev->dev_node = NULL;
> +
>  	/* check for proper unloading */
>  	if (p_dev->_irq || p_dev->_io || p_dev->_locked)
>  		printk(KERN_INFO "pcmcia: driver %s did not release config properly\n",
> diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
> index 45063b4..2539c0b 100644
> --- a/drivers/pcmcia/pcmcia_resource.c
> +++ b/drivers/pcmcia/pcmcia_resource.c
> @@ -947,7 +947,5 @@ void pcmcia_disable_device(struct pcmcia
>  	pcmcia_release_irq(p_dev, &p_dev->irq);
>  	if (&p_dev->win)
>  		pcmcia_release_window(p_dev->win);
> -
> -	p_dev->dev_node = NULL;
>  }
>  EXPORT_SYMBOL(pcmcia_disable_device);
> -- 
> 1.2.4



More information about the linux-pcmcia mailing list