diff options
author | Uri Shkolnik <uris@siano-ms.com> | 2009-05-12 10:28:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 18:14:27 -0400 |
commit | 8f12d0a4eb7c55837f0104c95c60933dc9c593db (patch) | |
tree | 10f792c0d4897d53c6406e11e6ba5946fb71db6d | |
parent | c7ce8d37a738b64cafae07db4de021edf1feaa70 (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>
-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) | |||
65 | struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context; | 65 | struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context; |
66 | struct smsusb_device_t *dev = surb->dev; | 66 | struct smsusb_device_t *dev = surb->dev; |
67 | 67 | ||
68 | if (urb->status < 0) { | 68 | if (urb->status == -ESHUTDOWN) { |
69 | sms_err("error, urb status %d, %d bytes", | 69 | sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", |
70 | urb->status, urb->actual_length); | 70 | urb->status, urb->actual_length); |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | 73 | ||
74 | if (urb->actual_length > 0) { | 74 | if ((urb->actual_length > 0) && (urb->status == 0)) { |
75 | struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) surb->cb->p; | 75 | struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)surb->cb->p; |
76 | 76 | ||
77 | smsendian_handle_message_header(phdr); | 77 | smsendian_handle_message_header(phdr); |
78 | if (urb->actual_length >= phdr->msgLength) { | 78 | if (urb->actual_length >= phdr->msgLength) { |
@@ -111,7 +111,10 @@ static void smsusb_onresponse(struct urb *urb) | |||
111 | "msglen %d actual %d", | 111 | "msglen %d actual %d", |
112 | phdr->msgLength, urb->actual_length); | 112 | phdr->msgLength, urb->actual_length); |
113 | } | 113 | } |
114 | } | 114 | } else |
115 | sms_err("error, urb status %d, %d bytes", | ||
116 | urb->status, urb->actual_length); | ||
117 | |||
115 | 118 | ||
116 | exit_and_resubmit: | 119 | exit_and_resubmit: |
117 | smsusb_submit_urb(dev, surb); | 120 | smsusb_submit_urb(dev, surb); |