diff options
| author | Michael Zhilin <mizhka@FreeBSD.org> | 2018-01-24 21:33:18 +0000 |
|---|---|---|
| committer | Michael Zhilin <mizhka@FreeBSD.org> | 2018-01-24 21:33:18 +0000 |
| commit | 0774131e27d6764f90967f6e2571ca84e8e6590f (patch) | |
| tree | abc6cd33d5111e5e366d73c7d6d19ab2c89b9fd9 /sys/dev/etherswitch | |
| parent | 9f747dc6dce54e03bb254f9ade85447587c0cf63 (diff) | |
Notes
Diffstat (limited to 'sys/dev/etherswitch')
| -rw-r--r-- | sys/dev/etherswitch/arswitch/arswitch.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/e6000sw/e6060sw.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/infineon/adm6996fc.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/ip17x/ip17x.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/micrel/ksz8995ma.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/mtkswitch/mtkswitch.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/rtl8366/rtl8366rb.c | 6 | ||||
| -rw-r--r-- | sys/dev/etherswitch/ukswitch/ukswitch.c | 6 |
8 files changed, 48 insertions, 0 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index c0098d7f2d352..26bd2f16fa776 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -177,6 +177,12 @@ arswitch_attach_phys(struct arswitch_softc *sc) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); for (phy = 0; phy < sc->numphys; phy++) { sc->ifp[phy] = if_alloc(IFT_ETHER); + if (sc->ifp[phy] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[phy]->if_softc = sc; sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c index fedc1e4ac9f62..4704e4b31b56d 100644 --- a/sys/dev/etherswitch/e6000sw/e6060sw.c +++ b/sys/dev/etherswitch/e6000sw/e6060sw.c @@ -218,6 +218,12 @@ e6060sw_attach_phys(struct e6060sw_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); + if (sc->ifp[port] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index a2f7e9d90b2bd..76e414afb9781 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -175,6 +175,12 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); + if (sc->ifp[port] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index ff1db9dbd68ac..53ced768b41ff 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -174,6 +174,12 @@ ip17x_attach_phys(struct ip17x_softc *sc) sc->phyport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); + if (sc->ifp[port] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index 4962d37178188..7c8dd695bae1c 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -221,6 +221,12 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); + if (sc->ifp[port] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c index 97464cac3e56a..d3a6efa487cae 100644 --- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -122,6 +122,12 @@ mtkswitch_attach_phys(struct mtkswitch_softc *sc) continue; } sc->ifp[phy] = if_alloc(IFT_ETHER); + if (sc->ifp[phy] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[phy]->if_softc = sc; sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index a80c27649f4bb..1fff39bfbac98 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -239,6 +239,12 @@ rtl8366rb_attach(device_t dev) /* PHYs need an interface, so we generate a dummy one */ for (i = 0; i < sc->numphys; i++) { sc->ifp[i] = if_alloc(IFT_ETHER); + if (sc->ifp[i] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[i]->if_softc = sc; sc->ifp[i]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c index cb063f4d634a5..8293db0fa5717 100644 --- a/sys/dev/etherswitch/ukswitch/ukswitch.c +++ b/sys/dev/etherswitch/ukswitch/ukswitch.c @@ -126,6 +126,12 @@ ukswitch_attach_phys(struct ukswitch_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); + if (sc->ifp[port] == NULL) { + device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); + err = ENOMEM; + break; + } + sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; |
