From aa3860851b9f6a6002d135b1cac7736e0995eedc Mon Sep 17 00:00:00 2001 From: Zhenlei Huang Date: Fri, 28 Jun 2024 18:16:29 +0800 Subject: 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 --- sys/dev/firewire/if_fwe.c | 6 +----- sys/dev/firewire/if_fwip.c | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'sys/dev/firewire') diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 60a9806656e8..44d3425799e9 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -178,10 +178,6 @@ fwe_attach(device_t dev) /* fill the rest and attach interface */ ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - return (ENOSPC); - } if_setsoftc(ifp, &fwe->eth_softc); if_initname(ifp, device_get_name(dev), unit); @@ -201,7 +197,7 @@ fwe_attach(device_t dev) if_setcapenablebit(ifp, IFCAP_VLAN_MTU, 0); FWEDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index b698db6c9620..6350ec9cb56e 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -153,8 +153,6 @@ fwip_attach(device_t dev) fwip = ((struct fwip_softc *)device_get_softc(dev)); unit = device_get_unit(dev); ifp = fwip->fw_softc.fwip_ifp = if_alloc(IFT_IEEE1394); - if (ifp == NULL) - return (ENOSPC); mtx_init(&fwip->mtx, "fwip", NULL, MTX_DEF); /* XXX */ @@ -199,7 +197,7 @@ fwip_attach(device_t dev) splx(s); FWIPDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void -- cgit v1.2.3