aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-05-13 18:26:55 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-05-13 18:26:55 +0000
commit7261357fbc5a00a7f6b858ada367d4dd44a5cef3 (patch)
tree27c18d8251f7f7ffafb1934cbb0c0d36861d7f76 /sys
parent8ea86e467f15ef8303f878ff95b756fd573dcdde (diff)
downloadsrc-7261357fbc5a00a7f6b858ada367d4dd44a5cef3.tar.gz
src-7261357fbc5a00a7f6b858ada367d4dd44a5cef3.zip
Ensure the bmRequestType is the right type for the incoming control request.
Submitted by: Hans Petter Selasky
Notes
Notes: svn path=/head/; revision=192057
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/storage/ustorage_fs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/storage/ustorage_fs.c b/sys/dev/usb/storage/ustorage_fs.c
index c810c2e0f190..8e8a50981a41 100644
--- a/sys/dev/usb/storage/ustorage_fs.c
+++ b/sys/dev/usb/storage/ustorage_fs.c
@@ -466,7 +466,8 @@ ustorage_fs_handle_request(device_t dev,
const struct usb2_device_request *req = preq;
if (!is_complete) {
- if (req->bRequest == UR_BBB_RESET) {
+ if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) &&
+ (req->bRequest == UR_BBB_RESET)) {
*plen = 0;
mtx_lock(&sc->sc_mtx);
ustorage_fs_transfer_stop(sc);
@@ -475,7 +476,8 @@ ustorage_fs_handle_request(device_t dev,
USTORAGE_FS_T_BBB_COMMAND);
mtx_unlock(&sc->sc_mtx);
return (0);
- } else if (req->bRequest == UR_BBB_GET_MAX_LUN) {
+ } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) &&
+ (req->bRequest == UR_BBB_GET_MAX_LUN)) {
if (offset == 0) {
*plen = 1;
*pptr = &sc->sc_last_lun;