diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-03-09 20:36:17 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-03-09 20:36:17 +0000 |
commit | 2ed5df380ecb6c6da11790afd11cd1be124e4091 (patch) | |
tree | 73967ff9f9ef9c98e711eee0ae5dbf354d650072 /sys/dev/pci | |
parent | 9ef0fb42c67aae46f4bbc96a1d995dd28dd8471d (diff) |
Make rtwn(4) check for "unsupported test chip" error during attach again.
ok mpi@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_rtwn.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c index fa84bbcbb70..d1fac937eab 100644 --- a/sys/dev/pci/if_rtwn.c +++ b/sys/dev/pci/if_rtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rtwn.c,v 1.16 2016/03/09 18:18:28 stsp Exp $ */ +/* $OpenBSD: if_rtwn.c,v 1.17 2016/03/09 20:36:16 stsp Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -305,6 +305,7 @@ rtwn_pci_attach(struct device *parent, struct device *self, void *aux) if (error != 0) { printf("%s: could not allocate Tx buffers\n", sc->sc_dev.dv_xname); + rtwn_free_rx_list(sc); return; } } @@ -324,7 +325,13 @@ rtwn_pci_attach(struct device *parent, struct device *self, void *aux) sc->sc_sc.sc_ops.disable_intr = rtwn_disable_intr; sc->sc_sc.sc_ops.stop = rtwn_pci_stop; sc->sc_sc.sc_ops.is_oactive = rtwn_is_oactive; - rtwn_attach(&sc->sc_dev, &sc->sc_sc); + error = rtwn_attach(&sc->sc_dev, &sc->sc_sc); + if (error != 0) { + rtwn_free_rx_list(sc); + for (i = 0; i < RTWN_NTXQUEUES; i++) + rtwn_free_tx_list(sc, i); + return; + } /* ifp is now valid */ ifp = &sc->sc_sc.sc_ic.ic_if; |