aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c6
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);