diff options
Diffstat (limited to 'drivers/net/irda/irda-usb.c')
-rw-r--r-- | drivers/net/irda/irda-usb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 4441fa3389c2..e4ea61944c22 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1124,11 +1124,11 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1124 | * The actual image starts after the "STMP" keyword | 1124 | * The actual image starts after the "STMP" keyword |
1125 | * so forward to the firmware header tag | 1125 | * so forward to the firmware header tag |
1126 | */ | 1126 | */ |
1127 | for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) && | 1127 | for (i = 0; i < fw->size && fw->data[i] != |
1128 | (i < fw->size); i++) ; | 1128 | STIR421X_PATCH_END_OF_HDR_TAG; i++) ; |
1129 | /* here we check for the out of buffer case */ | 1129 | /* here we check for the out of buffer case */ |
1130 | if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) && | 1130 | if (i < STIR421X_PATCH_CODE_OFFSET && i < fw->size && |
1131 | (i < STIR421X_PATCH_CODE_OFFSET)) { | 1131 | STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) { |
1132 | if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG, | 1132 | if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG, |
1133 | sizeof(STIR421X_PATCH_STMP_TAG) - 1)) { | 1133 | sizeof(STIR421X_PATCH_STMP_TAG) - 1)) { |
1134 | 1134 | ||
@@ -1514,7 +1514,7 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ | |||
1514 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", | 1514 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", |
1515 | __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); | 1515 | __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); |
1516 | 1516 | ||
1517 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); | 1517 | return (self->bulk_in_ep != 0) && (self->bulk_out_ep != 0); |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | #ifdef IU_DUMP_CLASS_DESC | 1520 | #ifdef IU_DUMP_CLASS_DESC |