diff options
author | thompsa <thompsa@FreeBSD.org> | 2010-01-10 19:18:49 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2010-01-10 19:18:49 +0000 |
commit | 0008a6fee1ccfb64b0ae19501d53a6bca766d3c7 (patch) | |
tree | ca6e3dc46ef96ef7005cea7c717bbbafc5116c48 /lib/libusb | |
parent | 221cc21e3dd519e49a4865234090d5d2a748700e (diff) | |
download | FreeBSD-src-0008a6fee1ccfb64b0ae19501d53a6bca766d3c7.zip FreeBSD-src-0008a6fee1ccfb64b0ae19501d53a6bca766d3c7.tar.gz |
Reset variable fields in case the transfer is opened again
Submitted by: Hans Petter Selasky
Diffstat (limited to 'lib/libusb')
-rw-r--r-- | lib/libusb/libusb20.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index 41f9ac7..1c75fc1 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -130,8 +130,19 @@ libusb20_tr_close(struct libusb20_transfer *xfer) if (xfer->ppBuffer) { free(xfer->ppBuffer); } - /* clear some fields */ + /* reset variable fields in case the transfer is opened again */ + xfer->priv_sc0 = 0; + xfer->priv_sc1 = 0; xfer->is_opened = 0; + xfer->is_pending = 0; + xfer->is_cancel = 0; + xfer->is_draining = 0; + xfer->is_restart = 0; + xfer->status = 0; + xfer->flags = 0; + xfer->nFrames = 0; + xfer->aFrames = 0; + xfer->timeout = 0; xfer->maxFrames = 0; xfer->maxTotalLength = 0; xfer->maxPacketLen = 0; |