[Bug 233606] bhyve: usb_mouse.c has dead code

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Nov 28 13:17:47 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233606

            Bug ID: 233606
           Summary: bhyve: usb_mouse.c has dead code
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: levon at movementarian.org

usr.sbin/bhyve/usb_mouse.c has this code:

static int
umouse_request(void *scarg, struct usb_data_xfer *xfer)
...
done:
        if (xfer->ureq && (xfer->ureq->bmRequestType & UT_WRITE) &&
            (err == USB_ERR_NORMAL_COMPLETION) && (data != NULL))
                data->blen = 0;
        else if (eshort)
                err = USB_ERR_SHORT_XFER;

However, UT_WRITE is 0, so this doesn't do what the author seems to have
expected.

Found with smatch; impact unknown.

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


More information about the freebsd-bugs mailing list