aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio/network
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/virtio/network
parent0d8da0df415091d6ceceb74e4b6f42a15a3269e3 (diff)
Diffstat (limited to 'sys/dev/virtio/network')
-rw-r--r--sys/dev/virtio/network/if_vtnet.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 9c14e688f364..0dc887b3d394 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -115,7 +115,7 @@ static void vtnet_free_rxtx_queues(struct vtnet_softc *);
static int vtnet_alloc_rx_filters(struct vtnet_softc *);
static void vtnet_free_rx_filters(struct vtnet_softc *);
static int vtnet_alloc_virtqueues(struct vtnet_softc *);
-static int vtnet_alloc_interface(struct vtnet_softc *);
+static void vtnet_alloc_interface(struct vtnet_softc *);
static int vtnet_setup_interface(struct vtnet_softc *);
static int vtnet_ioctl_mtu(struct vtnet_softc *, u_int);
static int vtnet_ioctl_ifflags(struct vtnet_softc *);
@@ -437,12 +437,7 @@ vtnet_attach(device_t dev)
callout_init_mtx(&sc->vtnet_tick_ch, VTNET_CORE_MTX(sc), 0);
vtnet_load_tunables(sc);
- error = vtnet_alloc_interface(sc);
- if (error) {
- device_printf(dev, "cannot allocate interface\n");
- goto fail;
- }
-
+ vtnet_alloc_interface(sc);
vtnet_setup_sysctl(sc);
error = vtnet_setup_features(sc);
@@ -1069,7 +1064,7 @@ vtnet_alloc_virtqueues(struct vtnet_softc *sc)
return (error);
}
-static int
+static void
vtnet_alloc_interface(struct vtnet_softc *sc)
{
device_t dev;
@@ -1078,14 +1073,9 @@ vtnet_alloc_interface(struct vtnet_softc *sc)
dev = sc->vtnet_dev;
ifp = if_alloc(IFT_ETHER);
- if (ifp == NULL)
- return (ENOMEM);
-
sc->vtnet_ifp = ifp;
if_setsoftc(ifp, sc);
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-
- return (0);
}
static int