Commit 5a26baff authored by Russell King's avatar Russell King

[PCMCIA] Don't add CIS cache entries on failure.

If we fail to map the CIS space, don't pollute the CIS cache with
invalid data.
parent 8bb27707
......@@ -293,15 +293,17 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
#endif
ret = read_cis_mem(s, attr, addr, len, ptr);
/* Copy data into the cache */
cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL);
if (cis) {
cis->addr = addr;
cis->len = len;
cis->attr = attr;
memcpy(cis->cache, ptr, len);
list_add(&cis->node, &s->cis_cache);
}
if (ret == 0) {
/* Copy data into the cache */
cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL);
if (cis) {
cis->addr = addr;
cis->len = len;
cis->attr = attr;
memcpy(cis->cache, ptr, len);
list_add(&cis->node, &s->cis_cache);
}
}
}
static void
......
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