.. | .. |
---|
157 | 157 | { |
---|
158 | 158 | struct orinoco_private *priv; |
---|
159 | 159 | struct orinoco_pccard *card; |
---|
| 160 | + int ret; |
---|
160 | 161 | |
---|
161 | 162 | priv = alloc_orinocodev(sizeof(*card), &link->dev, |
---|
162 | 163 | spectrum_cs_hard_reset, |
---|
.. | .. |
---|
169 | 170 | card->p_dev = link; |
---|
170 | 171 | link->priv = priv; |
---|
171 | 172 | |
---|
172 | | - return spectrum_cs_config(link); |
---|
173 | | -} /* spectrum_cs_attach */ |
---|
| 173 | + ret = spectrum_cs_config(link); |
---|
| 174 | + if (ret) |
---|
| 175 | + goto err_free_orinocodev; |
---|
| 176 | + |
---|
| 177 | + return 0; |
---|
| 178 | + |
---|
| 179 | +err_free_orinocodev: |
---|
| 180 | + free_orinocodev(priv); |
---|
| 181 | + return ret; |
---|
| 182 | +} |
---|
174 | 183 | |
---|
175 | 184 | static void spectrum_cs_detach(struct pcmcia_device *link) |
---|
176 | 185 | { |
---|