Commit 64d8d46f authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: properly lock skt->irq, skt->irq_mask

Tested-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 9e86749c
...@@ -419,7 +419,9 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) ...@@ -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"); dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
return -EINVAL; return -EINVAL;
} }
mutex_lock(&s->ops_mutex);
if (s->irq.AssignedIRQ != req->AssignedIRQ) { if (s->irq.AssignedIRQ != req->AssignedIRQ) {
mutex_unlock(&s->ops_mutex);
dev_dbg(&s->dev, "IRQ must match assigned one\n"); dev_dbg(&s->dev, "IRQ must match assigned one\n");
return -EINVAL; return -EINVAL;
} }
...@@ -434,6 +436,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) ...@@ -434,6 +436,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
#ifdef CONFIG_PCMCIA_PROBE #ifdef CONFIG_PCMCIA_PROBE
pcmcia_used_irq[req->AssignedIRQ]--; pcmcia_used_irq[req->AssignedIRQ]--;
#endif #endif
mutex_unlock(&s->ops_mutex);
return 0; return 0;
} /* pcmcia_release_irq */ } /* pcmcia_release_irq */
......
...@@ -167,7 +167,9 @@ static ssize_t pccard_store_irq_mask(struct device *dev, ...@@ -167,7 +167,9 @@ static ssize_t pccard_store_irq_mask(struct device *dev,
ret = sscanf(buf, "0x%x\n", &mask); ret = sscanf(buf, "0x%x\n", &mask);
if (ret == 1) { if (ret == 1) {
mutex_lock(&s->ops_mutex);
s->irq_mask &= mask; s->irq_mask &= mask;
mutex_unlock(&s->ops_mutex);
ret = 0; ret = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment