aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2024-06-28 10:16:29 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2024-06-28 10:16:29 +0000
commitaa3860851b9f6a6002d135b1cac7736e0995eedc (patch)
tree2721f1a2a301278f11ee2d4772107aa07d6f131f /sys/arm
parent0d8da0df415091d6ceceb74e4b6f42a15a3269e3 (diff)
downloadsrc-aa3860851b9f6a6002d135b1cac7736e0995eedc.tar.gz
src-aa3860851b9f6a6002d135b1cac7736e0995eedc.zip
net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/allwinner/if_emac.c5
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c5
2 files changed, 0 insertions, 10 deletions
diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c
index f581d361d3d9..1db43cbca26c 100644
--- a/sys/arm/allwinner/if_emac.c
+++ b/sys/arm/allwinner/if_emac.c
@@ -940,11 +940,6 @@ emac_attach(device_t dev)
emac_reset(sc);
ifp = sc->emac_ifp = if_alloc(IFT_ETHER);
- if (ifp == NULL) {
- device_printf(dev, "unable to allocate ifp\n");
- error = ENOSPC;
- goto fail;
- }
if_setsoftc(ifp, sc);
/* Setup MII */
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index c2651c33e1b1..8012f8441e76 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -1025,11 +1025,6 @@ cpswp_attach(device_t dev)
/* Allocate network interface */
ifp = sc->ifp = if_alloc(IFT_ETHER);
- if (ifp == NULL) {
- cpswp_detach(dev);
- return (ENXIO);
- }
-
if_initname(ifp, device_get_name(sc->dev), sc->unit);
if_setsoftc(ifp, sc);
if_setflags(ifp, IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST);