Re: [PATCH v2 1/1] usb: musb: gadget: misplaced out of bounds check

2018-03-20 Thread Sergei Shtylyov
Hello! On 3/20/2018 5:27 AM, Heinrich Schuchardt wrote: musb->endpoints[] has array size MUSB_C_NUM_EPS. We must check array bounds before accessing the array and not afterwards. Signed-off-by: Heinrich Schuchardt --- v2 Only the 4 low bits of epnum are relevant

[PATCH v2 1/1] usb: musb: gadget: misplaced out of bounds check

2018-03-19 Thread Heinrich Schuchardt
musb->endpoints[] has array size MUSB_C_NUM_EPS. We must check array bounds before accessing the array and not afterwards. Signed-off-by: Heinrich Schuchardt --- v2 Only the 4 low bits of epnum are relevant for indexing. --- drivers/usb/musb/musb_gadget_ep0.c | 9