hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
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 {