summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-05-12 14:28:41 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-05-12 14:28:41 +0000
commitdf4ef7800b3db4653ab235d8347dc17d876e8f67 (patch)
treef8990cd7042770414858187861a4e152333b6d3e /linux
parent68afa52d9809eae342ae42338b0b004ea71257a2 (diff)
downloadmediapointer-dvb-s2-df4ef7800b3db4653ab235d8347dc17d876e8f67.tar.gz
mediapointer-dvb-s2-df4ef7800b3db4653ab235d8347dc17d876e8f67.tar.bz2
Siano: smsusb - lost buffers bug fix
From: Uri Shkolnik <uris@siano-ms.com> This patch fixes a problem were protocol buffers have been lost during USB disconnect events. Priority: normal Signed-off-by: Uri Shkolnik <uris@siano-ms.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/siano/smsusb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c
index 17332a09a..7f0246fdb 100644
--- a/linux/drivers/media/dvb/siano/smsusb.c
+++ b/linux/drivers/media/dvb/siano/smsusb.c
@@ -69,14 +69,14 @@ static void smsusb_onresponse(struct urb *urb, struct pt_regs *regs)
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;
if (urb->actual_length >= phdr->msgLength) {
surb->cb->size = phdr->msgLength;
@@ -114,7 +114,10 @@ static void smsusb_onresponse(struct urb *urb, struct pt_regs *regs)
"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);