aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire
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/dev/firewire
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/dev/firewire')
-rw-r--r--sys/dev/firewire/if_fwe.c6
-rw-r--r--sys/dev/firewire/if_fwip.c4
2 files changed, 2 insertions, 8 deletions
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