inside the 'for' looping:
the return value 'rv' may override if not have a check in time.
the next checking (outside the 'for' looping):
can not find failure which generated during the 'for' looping
so need let outside know about the failure.
the original related commit is:
commit 0de9a7024e7ae62512d080c7e2beb59d82958cd5
Author: Oliver Neukum <[email protected]>
Date: Fri Mar 16 20:28:28 2007 +0100
Signed-off-by: Chen Gang <[email protected]>
---
drivers/usb/serial/mos7840.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index a0d5ea5..91e6c2c 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -585,7 +585,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
__u16 Data;
unsigned char *data;
__u8 sp[5], st;
- int i, rv = 0;
+ int i;
__u16 wval, wreg = 0;
int status = urb->status;
@@ -651,13 +651,18 @@ static void mos7840_interrupt_callback(struct urb *urb)
wreg = MODEM_STATUS_REGISTER;
break;
}
- rv = mos7840_get_reg(mos7840_port, wval, wreg,
&Data);
+ if (mos7840_get_reg(mos7840_port, wval, wreg,
+ &Data) < 0)
+ goto exit;
}
}
}
- if (!(rv < 0))
- /* the completion handler for the control urb will resubmit */
- return;
+
+ /*
+ * if all things ok, the completion handler for the control
+ * urb will resubmit
+ */
+ return;
exit:
result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) {
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html