Skip to content

Commit

Permalink
pcmcia: properly lock skt->irq, skt->irq_mask
Browse files Browse the repository at this point in the history
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Feb 17, 2010
1 parent 9e86749 commit 64d8d46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions drivers/pcmcia/socket_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 64d8d46

Please sign in to comment.