]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/gadget/f_fs.c
Merge 2.6.38-rc5 into usb-next
[~andy/linux] / drivers / usb / gadget / f_fs.c
index 1499f9e4afa83a70392efb794962c9577a5e5a1c..19fffccc370d3af1e368b5ccd8a98b844c89fa1d 100644 (file)
@@ -368,6 +368,14 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
        req->buf      = data;
        req->length   = len;
 
+       /*
+        * UDC layer requires to provide a buffer even for ZLP, but should
+        * not use it at all. Let's provide some poisoned pointer to catch
+        * possible bug in the driver.
+        */
+       if (req->buf == NULL)
+               req->buf = (void *)0xDEADBABE;
+
        INIT_COMPLETION(ffs->ep0req_completion);
 
        ret = usb_ep_queue(ffs->gadget->ep0, req, GFP_ATOMIC);