summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorUri Shkolnik <uris@siano-ms.com>2009-05-12 11:28:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 19:14:27 -0300
commit8f12d0a4eb7c55837f0104c95c60933dc9c593db (patch)
tree10f792c0d4897d53c6406e11e6ba5946fb71db6d /drivers/media
parentc7ce8d37a738b64cafae07db4de021edf1feaa70 (diff)
V4L/DVB (11778): Siano: smsusb - lost buffers bug fix
This patch fixes a problem were protocol buffers have been lost during USB disconnect events. Signed-off-by: Uri Shkolnik <uris@siano-ms.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/siano/smsusb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 1bcd0eff4b16..4fa38bd83887 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -65,14 +65,14 @@ static void smsusb_onresponse(struct urb *urb)
struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context;
struct smsusb_device_t *dev = surb->dev;
- if (urb->status < 0) {
- sms_err("error, urb status %d, %d bytes",
+ if (urb->status == -ESHUTDOWN) {
+ sms_err("error, urb status %d (-ESHUTDOWN), %d bytes",
urb->status, urb->actual_length);
return;
}
- if (urb->actual_length > 0) {
- struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) surb->cb->p;
+ if ((urb->actual_length > 0) && (urb->status == 0)) {
+ struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)surb->cb->p;
smsendian_handle_message_header(phdr);
if (urb->actual_length >= phdr->msgLength) {
@@ -111,7 +111,10 @@ static void smsusb_onresponse(struct urb *urb)
"msglen %d actual %d",
phdr->msgLength, urb->actual_length);
}
- }
+ } else
+ sms_err("error, urb status %d, %d bytes",
+ urb->status, urb->actual_length);
+
exit_and_resubmit:
smsusb_submit_urb(dev, surb);