aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2019-09-02 08:31:18 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2019-09-02 08:31:18 +0000
commitf6549df685bf3d620a1e76d45107ee8b831ab4e2 (patch)
treef8eb16becf3dd318eef194db890967d9b7b57227 /sys
parent389154096a6fd61224561d5b6171142fd854373f (diff)
downloadsrc-f6549df685bf3d620a1e76d45107ee8b831ab4e2.tar.gz
src-f6549df685bf3d620a1e76d45107ee8b831ab4e2.zip
Fix regression issue after r351616. Make sure the mbuf queue gets initialized.
Found by: gonzo@ MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=351692
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/net/usb_ethernet.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c
index 57be7d69d4ab..b637f1ace0e1 100644
--- a/sys/dev/usb/net/usb_ethernet.c
+++ b/sys/dev/usb/net/usb_ethernet.c
@@ -219,6 +219,7 @@ ue_attach_post_task(struct usb_proc_msg *_task)
ue->ue_unit = alloc_unr(ueunit);
usb_callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0);
sysctl_ctx_init(&ue->ue_sysctl_ctx);
+ mbufq_init(&ue->ue_rxq, 0 /* unlimited length */);
error = 0;
CURVNET_SET_QUIET(vnet0);
@@ -284,6 +285,11 @@ ue_attach_post_task(struct usb_proc_msg *_task)
fail:
CURVNET_RESTORE();
+
+ /* drain mbuf queue */
+ mbufq_drain(&ue->ue_rxq);
+
+ /* free unit */
free_unr(ueunit, ue->ue_unit);
if (ue->ue_ifp != NULL) {
if_free(ue->ue_ifp);
@@ -330,6 +336,9 @@ uether_ifdetach(struct usb_ether *ue)
/* free sysctl */
sysctl_ctx_free(&ue->ue_sysctl_ctx);
+ /* drain mbuf queue */
+ mbufq_drain(&ue->ue_rxq);
+
/* free unit */
free_unr(ueunit, ue->ue_unit);
}