diff options
author | Uri Shkolnik <uris@siano-ms.com> | 2009-05-12 16:28:41 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-17 00:14:27 +0200 |
commit | 8f12d0a4eb7c55837f0104c95c60933dc9c593db (patch) | |
tree | 10f792c0d4897d53c6406e11e6ba5946fb71db6d /drivers/media/dvb/siano/smsusb.c | |
parent | V4L/DVB (11777): Siano: smsusb - handle byte ordering and big endianity (diff) | |
download | linux-8f12d0a4eb7c55837f0104c95c60933dc9c593db.tar.xz linux-8f12d0a4eb7c55837f0104c95c60933dc9c593db.zip |
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/dvb/siano/smsusb.c')
-rw-r--r-- | drivers/media/dvb/siano/smsusb.c | 13 |
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); |