FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 07-12-2012, 04:06 PM
 
Default (pre-mainline) ALSA: snd-usb: tighten EP_FLAG_RUNNING checks

From: Joseph Salisbury <joseph.salisbury@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1018020

In endpoint.c, bail out earlier in case the stream is stopped. Also
clear the flag from deactivate_urbs() in case the chip's shutdown
flag is set.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
sound/usb/endpoint.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index e690690..a75bdf4 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -350,7 +350,8 @@ static void snd_complete_urb(struct urb *urb)
urb->status == -ENODEV || /* device removed */
urb->status == -ECONNRESET || /* unlinked */
urb->status == -ESHUTDOWN || /* device disabled */
- ep->chip->shutdown)) /* device disconnected */
+ ep->chip->shutdown) || /* device disconnected */
+ !test_bit(EP_FLAG_RUNNING, &ep->flags))
goto exit_clear;

if (usb_pipeout(ep->pipe)) {
@@ -522,13 +523,13 @@ static int deactivate_urbs(struct snd_usb_endpoint *ep, int force, int can_sleep
unsigned int i;
int async;

+ clear_bit(EP_FLAG_RUNNING, &ep->flags);
+
if (!force && ep->chip->shutdown) /* to be sure... */
return -EBADFD;

async = !can_sleep && ep->chip->async_unlink;

- clear_bit(EP_FLAG_RUNNING, &ep->flags);
-
INIT_LIST_HEAD(&ep->ready_playback_urbs);
ep->next_packet_read_pos = 0;
ep->next_packet_write_pos = 0;
--
1.7.9.5


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org