usb: gadget: Fixing array index out of bound violation
In mass_storage_function_init(), current code has array size
allocated as 2. Maximum number of luns which can be supported
is 3 (for cdrom, external memory and internal memory). Array
name[0] is initialized to "lun" as by default it is required to
support minimum one lun for external memory. For additional luns
support array index 1 and 2 is required to be used.
But with current code there would be array index out of bound
violation when name[2] is accessed. Hence fixing the issue by adding
correct size for the array to 3.
CRs-Fixed: 579049
Change-Id: Iad74a95205e503bf6a30dfac70b6ac1963df76a6
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
1 file changed