If if_initialize() failed in the attach function, return.
This commit is contained in:
parent
e4a9eb5a72
commit
82d818af91
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bwi.c,v 1.32 2017/07/29 01:19:29 riastradh Exp $ */
|
||||
/* $NetBSD: bwi.c,v 1.33 2017/10/23 09:27:21 msaitoh Exp $ */
|
||||
/* $OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.32 2017/07/29 01:19:29 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.33 2017/10/23 09:27:21 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/callout.h>
|
||||
|
@ -1021,7 +1021,12 @@ bwi_attach(struct bwi_softc *sc)
|
|||
|
||||
ic->ic_updateslot = bwi_updateslot;
|
||||
|
||||
if_initialize(ifp);
|
||||
error = if_initialize(ifp);
|
||||
if (error != 0) {
|
||||
aprint_error_dev(sc->sc_dev, "if_initialize failed(%d)\n",
|
||||
error);
|
||||
goto fail;
|
||||
}
|
||||
ieee80211_ifattach(ic);
|
||||
ifp->if_percpuq = if_percpuq_create(ifp);
|
||||
if_register(ifp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_wm.c,v 1.540 2017/10/20 09:26:13 msaitoh Exp $ */
|
||||
/* $NetBSD: if_wm.c,v 1.541 2017/10/23 09:27:21 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
|
||||
|
@ -83,7 +83,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.540 2017/10/20 09:26:13 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.541 2017/10/23 09:27:21 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_net_mpsafe.h"
|
||||
|
@ -2753,7 +2753,12 @@ alloc_retry:
|
|||
#endif
|
||||
|
||||
/* Attach the interface. */
|
||||
if_initialize(ifp);
|
||||
error = if_initialize(ifp);
|
||||
if (error != 0) {
|
||||
aprint_error_dev(sc->sc_dev, "if_initialize failed(%d)\n",
|
||||
error);
|
||||
return; /* Error */
|
||||
}
|
||||
sc->sc_ipq = if_percpuq_create(&sc->sc_ethercom.ec_if);
|
||||
ether_ifattach(ifp, enaddr);
|
||||
if_register(ifp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_upl.c,v 1.59 2017/01/12 18:26:08 maya Exp $ */
|
||||
/* $NetBSD: if_upl.c,v 1.60 2017/10/23 09:27:21 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.59 2017/01/12 18:26:08 maya Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.60 2017/10/23 09:27:21 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -228,6 +228,7 @@ upl_attach(device_t parent, device_t self, void *aux)
|
|||
usb_interface_descriptor_t *id;
|
||||
usb_endpoint_descriptor_t *ed;
|
||||
int i;
|
||||
int rv;
|
||||
|
||||
DPRINTFN(5,(" : upl_attach: sc=%p, dev=%p", sc, dev));
|
||||
|
||||
|
@ -307,7 +308,12 @@ upl_attach(device_t parent, device_t self, void *aux)
|
|||
IFQ_SET_READY(&ifp->if_snd);
|
||||
|
||||
/* Attach the interface. */
|
||||
if_initialize(ifp);
|
||||
rv = if_initialize(ifp);
|
||||
if (rv != 0) {
|
||||
aprint_error_dev(self, "if_initialize failed(%d)\n", rv);
|
||||
splx(s);
|
||||
return;
|
||||
}
|
||||
if_register(ifp);
|
||||
if_alloc_sadl(ifp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue