aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/neta/if_mvneta.c
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2024-06-28 10:16:29 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2024-10-08 10:07:18 +0000
commitf500e5c6c99bd4520daa4524113462e3cf68f032 (patch)
tree2695bb80fb519021541ee99fc4c00172f14082f0 /sys/dev/neta/if_mvneta.c
parent04393db0031382a3b2d7de037e862b33e3ea4bbe (diff)
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 MFC note: This is only a partial MFC, as some drivers do not exist in stable/13 branch. The if_epair(4) drifts too much from stable/14 so not included in this MFC. (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc) (cherry picked from commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3)
Diffstat (limited to 'sys/dev/neta/if_mvneta.c')
-rw-r--r--sys/dev/neta/if_mvneta.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c
index a18d0eeef95b..fa5b9a38ac73 100644
--- a/sys/dev/neta/if_mvneta.c
+++ b/sys/dev/neta/if_mvneta.c
@@ -620,11 +620,6 @@ mvneta_attach(device_t self)
/* Allocate network interface */
ifp = sc->ifp = if_alloc(IFT_ETHER);
- if (ifp == NULL) {
- device_printf(self, "if_alloc() failed\n");
- mvneta_detach(self);
- return (ENOMEM);
- }
if_initname(ifp, device_get_name(self), device_get_unit(self));
/*