This patch reduces context of the list_del mutex for the function hdm_enqueue(). Signed-off-by: Andrey Shvetsov <andrey.shvetsov@xxxxxx> Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx> --- drivers/staging/most/hdm-usb/hdm_usb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 90678c3..985365f 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -669,15 +669,11 @@ static int hdm_enqueue(struct most_interface *iface, int channel, init_completion(&anchor->urb_compl); mbo->priv = anchor; - spin_lock_irqsave(&mdev->anchor_list_lock[channel], flags); - list_add_tail(&anchor->list, &mdev->anchor_list[channel]); - spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags); - if ((mdev->padding_active[channel]) && (conf->direction & MOST_CH_TX)) if (hdm_add_padding(mdev, channel, mbo)) { retval = -EIO; - goto _error_1; + goto _error; } urb->transfer_dma = mbo->bus_address; @@ -705,6 +701,10 @@ static int hdm_enqueue(struct most_interface *iface, int channel, } urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + spin_lock_irqsave(&mdev->anchor_list_lock[channel], flags); + list_add_tail(&anchor->list, &mdev->anchor_list[channel]); + spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags); + retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) { dev_err(dev, "URB submit failed with error %d.\n", retval); -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel