diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-30 15:29:38 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-30 15:29:38 +0000 |
commit | 761fb9dc928dfb9fa78fe3ed6e9269c1fdcbc9b1 (patch) | |
tree | 89ade4f4adbc6bd27d8e73af1fb6c56d92bd9549 /linux/drivers/media/video/s2255drv.c | |
parent | a2d7371dbe37dfa05b77b635e401e96be28796a2 (diff) | |
download | mediapointer-dvb-s2-761fb9dc928dfb9fa78fe3ed6e9269c1fdcbc9b1.tar.gz mediapointer-dvb-s2-761fb9dc928dfb9fa78fe3ed6e9269c1fdcbc9b1.tar.bz2 |
patch: s2255drv: urb completion routine fixes
From: Dean Anderson <dean@sensoray.com>
Error count in read pipe completion corrected.
URB not resubmitted if shutting down.
URB not freed in completion routine if new urb_submit_fails.
(URB is freed on shutdown).
Priority: high
Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/s2255drv.c')
-rw-r--r-- | linux/drivers/media/video/s2255drv.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/linux/drivers/media/video/s2255drv.c b/linux/drivers/media/video/s2255drv.c index 12ced841e..8a939387a 100644 --- a/linux/drivers/media/video/s2255drv.c +++ b/linux/drivers/media/video/s2255drv.c @@ -2240,8 +2240,10 @@ static void read_pipe_completion(struct urb *purb) return; } status = purb->status; - if (status != 0) { - dprintk(2, "read_pipe_completion: err\n"); + /* if shutting down, do not resubmit, exit immediately */ + if (status == -ESHUTDOWN) { + dprintk(2, "read_pipe_completion: err shutdown\n"); + pipe_info->err_count++; return; } @@ -2250,9 +2252,13 @@ static void read_pipe_completion(struct urb *purb) return; } - s2255_read_video_callback(dev, pipe_info); + if (status == 0) + s2255_read_video_callback(dev, pipe_info); + else { + pipe_info->err_count++; + dprintk(1, "s2255drv: failed URB %d\n", status); + } - pipe_info->err_count = 0; pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint); /* reuse urb */ usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev, @@ -2264,7 +2270,6 @@ static void read_pipe_completion(struct urb *purb) if (pipe_info->state != 0) { if (usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL)) { dev_err(&dev->udev->dev, "error submitting urb\n"); - usb_free_urb(pipe_info->stream_urb); } } else { dprintk(2, "read pipe complete state 0\n"); |