hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/net/wireless/intersil/orinoco/spectrum_cs.c
....@@ -157,6 +157,7 @@
157157 {
158158 struct orinoco_private *priv;
159159 struct orinoco_pccard *card;
160
+ int ret;
160161
161162 priv = alloc_orinocodev(sizeof(*card), &link->dev,
162163 spectrum_cs_hard_reset,
....@@ -169,8 +170,16 @@
169170 card->p_dev = link;
170171 link->priv = priv;
171172
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
+}
174183
175184 static void spectrum_cs_detach(struct pcmcia_device *link)
176185 {
....@@ -278,12 +287,11 @@
278287 spectrum_cs_suspend(struct pcmcia_device *link)
279288 {
280289 struct orinoco_private *priv = link->priv;
281
- int err = 0;
282290
283291 /* Mark the device as stopped, to block IO until later */
284292 orinoco_down(priv);
285293
286
- return err;
294
+ return 0;
287295 }
288296
289297 static int