diff options
Diffstat (limited to 'drivers/net/irda/irda-usb.c')
-rw-r--r-- | drivers/net/irda/irda-usb.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 215adf6377d0..2c9b3af16612 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -852,7 +852,7 @@ static void irda_usb_receive(struct urb *urb) | |||
852 | * hot unplug of the dongle... | 852 | * hot unplug of the dongle... |
853 | * Lowest effective timer is 10ms... | 853 | * Lowest effective timer is 10ms... |
854 | * Jean II */ | 854 | * Jean II */ |
855 | self->rx_defer_timer.function = &irda_usb_rx_defer_expired; | 855 | self->rx_defer_timer.function = irda_usb_rx_defer_expired; |
856 | self->rx_defer_timer.data = (unsigned long) urb; | 856 | self->rx_defer_timer.data = (unsigned long) urb; |
857 | mod_timer(&self->rx_defer_timer, jiffies + (10 * HZ / 1000)); | 857 | mod_timer(&self->rx_defer_timer, jiffies + (10 * HZ / 1000)); |
858 | return; | 858 | return; |
@@ -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; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) && |
1128 | && (i < fw->size); i++) ; | 1128 | (i < fw->size); 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 ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) && |
1131 | && (i < STIR421X_PATCH_CODE_OFFSET)) { | 1131 | (i < STIR421X_PATCH_CODE_OFFSET)) { |
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 | ||
@@ -1651,6 +1651,8 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1651 | 1651 | ||
1652 | self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *), | 1652 | self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *), |
1653 | GFP_KERNEL); | 1653 | GFP_KERNEL); |
1654 | if (!self->rx_urb) | ||
1655 | goto err_free_net; | ||
1654 | 1656 | ||
1655 | for (i = 0; i < self->max_rx_urb; i++) { | 1657 | for (i = 0; i < self->max_rx_urb; i++) { |
1656 | self->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL); | 1658 | self->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL); |
@@ -1783,6 +1785,8 @@ err_out_2: | |||
1783 | err_out_1: | 1785 | err_out_1: |
1784 | for (i = 0; i < self->max_rx_urb; i++) | 1786 | for (i = 0; i < self->max_rx_urb; i++) |
1785 | usb_free_urb(self->rx_urb[i]); | 1787 | usb_free_urb(self->rx_urb[i]); |
1788 | kfree(self->rx_urb); | ||
1789 | err_free_net: | ||
1786 | free_netdev(net); | 1790 | free_netdev(net); |
1787 | err_out: | 1791 | err_out: |
1788 | return ret; | 1792 | return ret; |