summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-07-30 13:29:44 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2010-07-30 13:29:44 +1000
commit029a2d17627b5c9361e166c81b26f2ae22974bf6 (patch)
tree2817ac5728673f5635e91d3b598c0f44f368e889
parenta0c95fc8d646ce04e463e7259ffcd42aed5813d3 (diff)
parent1d71d682e1e4c6639f6c28042a1a2bc73c5e0554 (diff)
Merge remote branch 'irda/for-next'
Conflicts: drivers/net/irda/irda-usb.c
-rw-r--r--drivers/net/irda/irda-usb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 4441fa3389c2..e4e71f32746b 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1124,11 +1124,12 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
* The actual image starts after the "STMP" keyword
* so forward to the firmware header tag
*/
- for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) &&
- (i < fw->size); i++) ;
+ for (i = 0; i < fw->size && fw->data[i] !=
+ STIR421X_PATCH_END_OF_HDR_TAG; i++)
+ ;
/* here we check for the out of buffer case */
- if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) &&
- (i < STIR421X_PATCH_CODE_OFFSET)) {
+ if (i < STIR421X_PATCH_CODE_OFFSET && i < fw->size &&
+ STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) {
if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG,
sizeof(STIR421X_PATCH_STMP_TAG) - 1)) {