tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: usbd_do_request_flags_pipe diagnostic panic



Hi,

On 2015/06/07 19:50, Nick Hudson wrote:
On 06/06/15 05:39, takahiro hayashi wrote:
Hello,

On nick-nhusb branch kernel panics in usbd_transfer() when the
zero-length request gets stalled.

This happens when the uhidev driver issues usbd_set_idle to my
USB keyboard, one of its uhidevs returns stall for SET_IDLE request.

While usbd_do_request_flags_pipe() processes the xfer for SET_IDLE,
it tries to read endpoint's status and clear stall condition
if the endpoint is stalled.
It reuses the xfer to store GET_STATUS request, but ux_buf of xfer
is not allocated, then KASSERT at line 298 in usbd_transfer() fails.

Should usbd_do_request*() allocate ux_buf even if ux_length is 0?
Should I file PR this prob?

How about this diff?

Does KASSERT(xfer->ux_buf == NULL) in usbd_alloc_buffer() fail
when valid buffer (data) is given and the request causes stall?



Nick

--
t-hash


Home | Main Index | Thread Index | Old Index