diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-12 16:05:36 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-02-17 11:48:14 -0500 |
commit | 8680c4b3faa298dc768c2a78a94a84d89854eca9 (patch) | |
tree | fe6faa7b62cf52ce8823027e833d946d11523e4a /drivers/pcmcia/ds.c | |
parent | 6b8e087b86c59c3941e125738d30cf38014089e0 (diff) |
pcmcia: also lock fake and cache CIS by ops_mutex
Specifically,
struct list_head cis_cache;
size_t fake_cis_len;
u8 *fake_cis;
are protected.
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 0ab4fe045920..4f7308df22c8 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -1241,12 +1241,16 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) | |||
1241 | s->pcmcia_state.present = 0; | 1241 | s->pcmcia_state.present = 0; |
1242 | pcmcia_card_remove(skt, NULL); | 1242 | pcmcia_card_remove(skt, NULL); |
1243 | handle_event(skt, event); | 1243 | handle_event(skt, event); |
1244 | mutex_lock(&s->ops_mutex); | ||
1244 | destroy_cis_cache(s); | 1245 | destroy_cis_cache(s); |
1246 | mutex_unlock(&s->ops_mutex); | ||
1245 | break; | 1247 | break; |
1246 | 1248 | ||
1247 | case CS_EVENT_CARD_INSERTION: | 1249 | case CS_EVENT_CARD_INSERTION: |
1248 | s->pcmcia_state.present = 1; | 1250 | s->pcmcia_state.present = 1; |
1251 | mutex_lock(&s->ops_mutex); | ||
1249 | destroy_cis_cache(s); /* to be on the safe side... */ | 1252 | destroy_cis_cache(s); /* to be on the safe side... */ |
1253 | mutex_unlock(&s->ops_mutex); | ||
1250 | pcmcia_card_add(skt); | 1254 | pcmcia_card_add(skt); |
1251 | handle_event(skt, event); | 1255 | handle_event(skt, event); |
1252 | break; | 1256 | break; |
@@ -1259,9 +1263,11 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) | |||
1259 | dev_dbg(&skt->dev, "cis mismatch - different card\n"); | 1263 | dev_dbg(&skt->dev, "cis mismatch - different card\n"); |
1260 | /* first, remove the card */ | 1264 | /* first, remove the card */ |
1261 | ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH); | 1265 | ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH); |
1266 | mutex_lock(&s->ops_mutex); | ||
1262 | destroy_cis_cache(skt); | 1267 | destroy_cis_cache(skt); |
1263 | kfree(skt->fake_cis); | 1268 | kfree(skt->fake_cis); |
1264 | skt->fake_cis = NULL; | 1269 | skt->fake_cis = NULL; |
1270 | mutex_unlock(&s->ops_mutex); | ||
1265 | /* now, add the new card */ | 1271 | /* now, add the new card */ |
1266 | ds_event(skt, CS_EVENT_CARD_INSERTION, | 1272 | ds_event(skt, CS_EVENT_CARD_INSERTION, |
1267 | CS_EVENT_PRI_LOW); | 1273 | CS_EVENT_PRI_LOW); |