From patchwork Mon Jun 29 02:32:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 243061 List-Id: U-Boot discussion From: peng.fan at nxp.com (Peng Fan) Date: Mon, 29 Jun 2020 10:32:54 +0800 Subject: [PATCH 3/7] f_sdp: Fix wrong usb request size In-Reply-To: <20200629023258.25452-1-peng.fan@nxp.com> References: <20200629023258.25452-1-peng.fan@nxp.com> Message-ID: <20200629023258.25452-3-peng.fan@nxp.com> From: Ye Li 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 Signed-off-by: Peng Fan --- drivers/usb/gadget/f_sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index f971ccdeca..eec7560fc2 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -548,7 +548,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)