diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/cardbus.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 3f6d51d11374..2d7effe7990d 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c | |||
@@ -138,7 +138,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void | |||
138 | 138 | ||
139 | cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len); | 139 | cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len); |
140 | 140 | ||
141 | dev = pci_find_slot(s->cb_dev->subordinate->number, 0); | 141 | dev = pci_get_slot(s->cb_dev->subordinate, 0); |
142 | if (!dev) | 142 | if (!dev) |
143 | goto fail; | 143 | goto fail; |
144 | 144 | ||
@@ -152,6 +152,9 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void | |||
152 | } | 152 | } |
153 | 153 | ||
154 | res = dev->resource + space - 1; | 154 | res = dev->resource + space - 1; |
155 | |||
156 | pci_dev_put(dev); | ||
157 | |||
155 | if (!res->flags) | 158 | if (!res->flags) |
156 | goto fail; | 159 | goto fail; |
157 | 160 | ||