aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/irda-usb.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/irda/irda-usb.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/irda/irda-usb.c')
-rw-r--r--drivers/net/irda/irda-usb.c14
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:
1783err_out_1: 1785err_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);
1789err_free_net:
1786 free_netdev(net); 1790 free_netdev(net);
1787err_out: 1791err_out:
1788 return ret; 1792 return ret;