Date: Wed, 13 May 2009 18:26:56 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r192057 - head/sys/dev/usb/storage Message-ID: <200905131826.n4DIQu5V064064@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Wed May 13 18:26:55 2009 New Revision: 192057 URL: http://svn.freebsd.org/changeset/base/192057 Log: Ensure the bmRequestType is the right type for the incoming control request. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/ustorage_fs.c Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Wed May 13 18:25:14 2009 (r192056) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed May 13 18:26:55 2009 (r192057) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905131826.n4DIQu5V064064>