summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2017-10-23 09:22:24 +0000
committermsaitoh <msaitoh@NetBSD.org>2017-10-23 09:22:24 +0000
commitdec70a2f2bd9a0948d6ce1273f00823891c8845a (patch)
tree21fa02e025a31bba8f070136c820b58025e14861 /sys/dev
parent20ea040db147704f36cfe128ff2aba61ee6caee4 (diff)
If if_attach() failed in the attach function, return.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/smc90cx6.c13
-rw-r--r--sys/dev/ic/smc90cx6var.h4
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/ic/smc90cx6.c b/sys/dev/ic/smc90cx6.c
index 2348a5bef83..1559af763d8 100644
--- a/sys/dev/ic/smc90cx6.c
+++ b/sys/dev/ic/smc90cx6.c
@@ -1,4 +1,4 @@
-/* $NetBSD: smc90cx6.c,v 1.70 2017/05/23 02:43:13 ozaki-r Exp $ */
+/* $NetBSD: smc90cx6.c,v 1.71 2017/10/23 09:22:24 msaitoh Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.70 2017/05/23 02:43:13 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.71 2017/10/23 09:22:24 msaitoh Exp $");
/* #define BAHSOFTCOPY */
#define BAHRETRANSMIT /**/
@@ -140,11 +140,11 @@ void bah_reconwatch(void *);
#define GETMEM(off) bus_space_read_1(bst_m, mem, (off))
#define PUTMEM(off, v) bus_space_write_1(bst_m, mem, (off), (v))
-void
+int
bah_attach_subr(struct bah_softc *sc)
{
struct ifnet *ifp = &sc->sc_arccom.ac_if;
- int s;
+ int s, rv;
u_int8_t linkaddress;
bus_space_tag_t bst_r = sc->sc_bst_r;
@@ -197,7 +197,9 @@ bah_attach_subr(struct bah_softc *sc)
ifp->if_mtu = ARCMTU;
- arc_ifattach(ifp, linkaddress);
+ rv = arc_ifattach(ifp, linkaddress);
+ if (rv != 0)
+ return rv;
if_deferred_start_init(ifp, NULL);
#ifdef BAHSOFTCOPY
@@ -207,6 +209,7 @@ bah_attach_subr(struct bah_softc *sc)
#endif
callout_init(&sc->sc_recon_ch, 0);
+ return 0;
}
/*
diff --git a/sys/dev/ic/smc90cx6var.h b/sys/dev/ic/smc90cx6var.h
index 94af627c1b7..ecde95b8706 100644
--- a/sys/dev/ic/smc90cx6var.h
+++ b/sys/dev/ic/smc90cx6var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: smc90cx6var.h,v 1.11 2012/10/27 17:18:22 chs Exp $ */
+/* $NetBSD: smc90cx6var.h,v 1.12 2017/10/23 09:22:24 msaitoh Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ struct bah_softc {
u_char sc_retransmits[2]; /* unused at the moment */
};
-void bah_attach_subr(struct bah_softc *);
+int bah_attach_subr(struct bah_softc *);
int bahintr(void *);
#endif