Skip to content

Commit

Permalink
USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
Browse files Browse the repository at this point in the history
Removes allocation of coherent buffer for the control-request setup-packet
buffer from the yurex driver. Using coherent buffers for setup-packet is
obsolete and does not work with some USB host implementations.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tomoki Sekiyama authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent f4a728d commit 523fc5c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/misc/yurex.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref)
usb_put_dev(dev->udev);
if (dev->cntl_urb) {
usb_kill_urb(dev->cntl_urb);
if (dev->cntl_req)
usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
dev->cntl_req, dev->cntl_urb->setup_dma);
kfree(dev->cntl_req);
if (dev->cntl_buffer)
usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
dev->cntl_buffer, dev->cntl_urb->transfer_dma);
Expand Down Expand Up @@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
}

/* allocate buffer for control req */
dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
GFP_KERNEL,
&dev->cntl_urb->setup_dma);
dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
if (!dev->cntl_req) {
err("Could not allocate cntl_req");
goto error;
Expand Down

0 comments on commit 523fc5c

Please sign in to comment.