aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pcmcia/cardbus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index a1bd763b4e33..714baaeb6da1 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -143,7 +143,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
143 /* Config space? */ 143 /* Config space? */
144 if (space == 0) { 144 if (space == 0) {
145 if (addr + len > 0x100) 145 if (addr + len > 0x100)
146 goto fail; 146 goto failput;
147 for (; len; addr++, ptr++, len--) 147 for (; len; addr++, ptr++, len--)
148 pci_read_config_byte(dev, addr, ptr); 148 pci_read_config_byte(dev, addr, ptr);
149 return 0; 149 return 0;
@@ -171,6 +171,8 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
171 memcpy_fromio(ptr, s->cb_cis_virt + addr, len); 171 memcpy_fromio(ptr, s->cb_cis_virt + addr, len);
172 return 0; 172 return 0;
173 173
174failput:
175 pci_dev_put(dev);
174fail: 176fail:
175 memset(ptr, 0xff, len); 177 memset(ptr, 0xff, len);
176 return -1; 178 return -1;