Fix regression issue after r351616. Make sure the mbuf queue gets initialized.

Found by:	gonzo@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-09-02 08:31:18 +00:00
parent 389154096a
commit f6549df685
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351692

View File

@ -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);
}