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,6 +293,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -293,6 +293,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
#endif #endif
ret = read_cis_mem(s, attr, addr, len, ptr); ret = read_cis_mem(s, attr, addr, len, ptr);
if (ret == 0) {
/* Copy data into the cache */ /* Copy data into the cache */
cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL); cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL);
if (cis) { if (cis) {
...@@ -302,6 +303,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -302,6 +303,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
memcpy(cis->cache, ptr, len); memcpy(cis->cache, ptr, len);
list_add(&cis->node, &s->cis_cache); list_add(&cis->node, &s->cis_cache);
} }
}
} }
static void 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