aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-05 15:09:27 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-05 15:09:27 -0700
commit979eef33267ec230b820f4f76b2103e8b567fa57 (patch)
tree626d47f5c575424c90965ddf5ff35c70d09e0948 /drivers/usb/musb/musb_gadget.c
parentMerge 3.5-rc5 into usb-next (diff)
parentusb: musb: host: Disable MUSB DMA mode incase of DMA channel request failure (diff)
downloadlinux-dev-979eef33267ec230b820f4f76b2103e8b567fa57.tar.xz
linux-dev-979eef33267ec230b820f4f76b2103e8b567fa57.zip
Merge tag 'musb-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
usb: musb: patches for v3.6 merge window Just two patches here: First we have a fix to disable DMA in case DMA channel request fails. Second, there's a fix for situations where the user kills musb (by rmmod or any other means) while a transfer is on the fly. In such cases, we could be led into a NULL pointer dereference due to endpoint being disabled and endpoint descriptor being NULL.
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r--drivers/usb/musb/musb_gadget.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 95918dacc99a..f7194cf65aba 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -328,6 +328,13 @@ static void txstate(struct musb *musb, struct musb_request *req)
musb_ep = req->ep;
+ /* Check if EP is disabled */
+ if (!musb_ep->desc) {
+ dev_dbg(musb->controller, "ep:%s disabled - ignore request\n",
+ musb_ep->end_point.name);
+ return;
+ }
+
/* we shouldn't get here while DMA is active ... but we do ... */
if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
dev_dbg(musb->controller, "dma pending...\n");
@@ -650,6 +657,13 @@ static void rxstate(struct musb *musb, struct musb_request *req)
len = musb_ep->packet_sz;
+ /* Check if EP is disabled */
+ if (!musb_ep->desc) {
+ dev_dbg(musb->controller, "ep:%s disabled - ignore request\n",
+ musb_ep->end_point.name);
+ return;
+ }
+
/* We shouldn't get here while DMA is active, but we do... */
if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
dev_dbg(musb->controller, "DMA pending...\n");