Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Sep 2018 10:08:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        usb@FreeBSD.org
Subject:   [Bug 231076] libusb_cancel_transfer() does NOT cancel a transfer after the USB device is removed
Message-ID:  <bug-231076-19105-GXUQwGwyTM@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-231076-19105@https.bugs.freebsd.org/bugzilla/>
References:  <bug-231076-19105@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231076

--- Comment #9 from Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> -=
--
When the USB device is removed libusb10_handle_events_sub() will call
libusb10_cancel_all_transfer() at
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L170

libusb10_cancel_all_transfer() will then call libusb20_tr_close() at
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.c#L1570

libusb20_tr_close() will then reset the variable fields at
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb20.c#L142

So when libusb_cancel_transfer() is called by my code the fields priv_sc0 a=
nd
priv_sc1 are already reset to 0 and libusb_cancel_transfer() returns
LIBUSB_ERROR_NOT_FOUND in
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.c#L1547

I can test any patch you propose to fix the issue.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-231076-19105-GXUQwGwyTM>