MLK-20559-4 f_sdp: Fix wrong usb request size
authorYe Li <ye.li@nxp.com>
Thu, 3 Jan 2019 08:41:07 +0000 (00:41 -0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 10:38:53 +0000 (03:38 -0700)
Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 6ca3fc0bbdbcc6d870ceffa9d38c47d2e4edfee4)

drivers/usb/gadget/f_sdp.c

index f559e2e..af76a7b 100644 (file)
@@ -546,7 +546,7 @@ static struct usb_request *sdp_start_ep(struct usb_ep *ep)
 {
        struct usb_request *req;
 
-       req = alloc_ep_req(ep, 64);
+       req = alloc_ep_req(ep, 65);
        debug("%s: ep:%p req:%p\n", __func__, ep, req);
 
        if (!req)