lkml.org 
[lkml]   [2018]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/1] usb: musb: gadget: misplaced out of bounds check
Hi,

On Tue, Mar 20, 2018 at 07:42:48PM +0100, 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 <xypron.glpk@gmx.de>
> ---
> v3
> Remove superfluous braces.
> v2
> Only the 4 low bits of epnum are relevant for indexing.
> ---
> drivers/usb/musb/musb_gadget_ep0.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)


Applied. Thanks.

Regards,
-Bin.

\
 
 \ /
  Last update: 2018-03-20 19:56    [W:0.202 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site