From 64d8d46f5f501a19aec4db7ff93faf1b831d05ed Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 16 Jan 2010 01:14:38 +0100 Subject: pcmcia: properly lock skt->irq, skt->irq_mask Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 3 +++ drivers/pcmcia/socket_sysfs.c | 2 ++ 2 files changed, 5 insertions(+) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index f365ecb9c5cd..f0de7b8b123b 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -419,7 +419,9 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n"); return -EINVAL; } + mutex_lock(&s->ops_mutex); if (s->irq.AssignedIRQ != req->AssignedIRQ) { + mutex_unlock(&s->ops_mutex); dev_dbg(&s->dev, "IRQ must match assigned one\n"); return -EINVAL; } @@ -434,6 +436,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) #ifdef CONFIG_PCMCIA_PROBE pcmcia_used_irq[req->AssignedIRQ]--; #endif + mutex_unlock(&s->ops_mutex); return 0; } /* pcmcia_release_irq */ diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index 537d79305e7a..1cba9d38d813 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c @@ -167,7 +167,9 @@ static ssize_t pccard_store_irq_mask(struct device *dev, ret = sscanf(buf, "0x%x\n", &mask); if (ret == 1) { + mutex_lock(&s->ops_mutex); s->irq_mask &= mask; + mutex_unlock(&s->ops_mutex); ret = 0; } -- cgit v1.2.3