.. | .. |
---|
96 | 96 | { |
---|
97 | 97 | struct orinoco_private *priv; |
---|
98 | 98 | struct orinoco_pccard *card; |
---|
| 99 | + int ret; |
---|
99 | 100 | |
---|
100 | 101 | priv = alloc_orinocodev(sizeof(*card), &link->dev, |
---|
101 | 102 | orinoco_cs_hard_reset, NULL); |
---|
.. | .. |
---|
107 | 108 | card->p_dev = link; |
---|
108 | 109 | link->priv = priv; |
---|
109 | 110 | |
---|
110 | | - return orinoco_cs_config(link); |
---|
111 | | -} /* orinoco_cs_attach */ |
---|
| 111 | + ret = orinoco_cs_config(link); |
---|
| 112 | + if (ret) |
---|
| 113 | + goto err_free_orinocodev; |
---|
| 114 | + |
---|
| 115 | + return 0; |
---|
| 116 | + |
---|
| 117 | +err_free_orinocodev: |
---|
| 118 | + free_orinocodev(priv); |
---|
| 119 | + return ret; |
---|
| 120 | +} |
---|
112 | 121 | |
---|
113 | 122 | static void orinoco_cs_detach(struct pcmcia_device *link) |
---|
114 | 123 | { |
---|