Some UDC drivers fails to queue a request if req->buf == NULL even for ZLP requests. This patch add support for dummy request buffer in case of ZLP request. Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> --- drivers/usb/gadget/f_fs.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 1499f9e..f0a0907 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c @@ -356,6 +356,7 @@ static void ffs_ep0_complete(struct usb_ep *ep, struct usb_request *req) complete_all(&ffs->ep0req_completion); } +static char ffs_tmp_buf[1]; static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) { struct usb_request *req = ffs->ep0req; @@ -368,6 +369,10 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) req->buf = data; req->length = len; + /* UDC layer require to provide a buffer even for ZLP */ + if (req->buf == NULL) + req->buf = ffs_tmp_buf; + INIT_COMPLETION(ffs->ep0req_completion); ret = usb_ep_queue(ffs->gadget->ep0, req, GFP_ATOMIC); -- 1.7.1.569.g6f426 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html