Re: [Qemu-devel] [PATCH 1/2] usb: rearrange usb_ep_get()

2019-01-31 Thread Gerd Hoffmann
On Wed, Jan 30, 2019 at 02:37:01PM +, Liam Merwick wrote: > There is no need to calculate the 'eps' variable in usb_ep_get() > if 'ep' is the control endpoint. Instead the calculation should > be done after validating the input and the resulting pointer also > validated before returning an

[Qemu-devel] [PATCH 1/2] usb: rearrange usb_ep_get()

2019-01-30 Thread Liam Merwick
There is no need to calculate the 'eps' variable in usb_ep_get() if 'ep' is the control endpoint. Instead the calculation should be done after validating the input and the resulting pointer also validated before returning an entry indexed on the endpoint 'ep'. Signed-off-by: Liam Merwick