aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/ipheth.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index fd1033130a81..418825d26f90 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -122,25 +122,25 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
122 122
123 tx_urb = usb_alloc_urb(0, GFP_KERNEL); 123 tx_urb = usb_alloc_urb(0, GFP_KERNEL);
124 if (tx_urb == NULL) 124 if (tx_urb == NULL)
125 goto error; 125 goto error_nomem;
126 126
127 rx_urb = usb_alloc_urb(0, GFP_KERNEL); 127 rx_urb = usb_alloc_urb(0, GFP_KERNEL);
128 if (rx_urb == NULL) 128 if (rx_urb == NULL)
129 goto error; 129 goto free_tx_urb;
130 130
131 tx_buf = usb_buffer_alloc(iphone->udev, 131 tx_buf = usb_buffer_alloc(iphone->udev,
132 IPHETH_BUF_SIZE, 132 IPHETH_BUF_SIZE,
133 GFP_KERNEL, 133 GFP_KERNEL,
134 &tx_urb->transfer_dma); 134 &tx_urb->transfer_dma);
135 if (tx_buf == NULL) 135 if (tx_buf == NULL)
136 goto error; 136 goto free_rx_urb;
137 137
138 rx_buf = usb_buffer_alloc(iphone->udev, 138 rx_buf = usb_buffer_alloc(iphone->udev,
139 IPHETH_BUF_SIZE, 139 IPHETH_BUF_SIZE,
140 GFP_KERNEL, 140 GFP_KERNEL,
141 &rx_urb->transfer_dma); 141 &rx_urb->transfer_dma);
142 if (rx_buf == NULL) 142 if (rx_buf == NULL)
143 goto error; 143 goto free_tx_buf;
144 144
145 145
146 iphone->tx_urb = tx_urb; 146 iphone->tx_urb = tx_urb;
@@ -149,13 +149,14 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
149 iphone->rx_buf = rx_buf; 149 iphone->rx_buf = rx_buf;
150 return 0; 150 return 0;
151 151
152error: 152free_tx_buf:
153 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, rx_buf,
154 rx_urb->transfer_dma);
155 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf, 153 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
156 tx_urb->transfer_dma); 154 tx_urb->transfer_dma);
155free_rx_urb:
157 usb_free_urb(rx_urb); 156 usb_free_urb(rx_urb);
157free_tx_urb:
158 usb_free_urb(tx_urb); 158 usb_free_urb(tx_urb);
159error_nomem:
159 return -ENOMEM; 160 return -ENOMEM;
160} 161}
161 162