aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/atm/usbatm.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index e134e2794486..bb2b5d256e34 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -298,7 +298,6 @@ static void usbatm_extract_cells(struct usbatm_data *instance,
298 struct usbatm_vcc_data *cached_vcc = NULL; 298 struct usbatm_vcc_data *cached_vcc = NULL;
299 struct atm_vcc *vcc; 299 struct atm_vcc *vcc;
300 struct sk_buff *sarb; 300 struct sk_buff *sarb;
301 struct usbatm_vcc_data *vcc_data;
302 unsigned int stride = instance->rx_channel.stride; 301 unsigned int stride = instance->rx_channel.stride;
303 int vci, cached_vci = 0; 302 int vci, cached_vci = 0;
304 short vpi, cached_vpi = 0; 303 short vpi, cached_vpi = 0;
@@ -311,18 +310,20 @@ static void usbatm_extract_cells(struct usbatm_data *instance,
311 310
312 vdbg("%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti); 311 vdbg("%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti);
313 312
314 if (cached_vcc && (vci == cached_vci) && (vpi == cached_vpi)) 313 if ((vci != cached_vci) || (vpi != cached_vpi)) {
315 vcc_data = cached_vcc;
316 else if ((vcc_data = usbatm_find_vcc(instance, vpi, vci))) {
317 cached_vcc = vcc_data;
318 cached_vpi = vpi; 314 cached_vpi = vpi;
319 cached_vci = vci; 315 cached_vci = vci;
320 } else { 316
321 atm_dbg(instance, "%s: unknown vpi/vci (%hd/%d)!\n", __func__, vpi, vci); 317 cached_vcc = usbatm_find_vcc(instance, vpi, vci);
322 continue; 318
319 if (!cached_vcc)
320 atm_dbg(instance, "%s: unknown vpi/vci (%hd/%d)!\n", __func__, vpi, vci);
323 } 321 }
324 322
325 vcc = vcc_data->vcc; 323 if (!cached_vcc)
324 continue;
325
326 vcc = cached_vcc->vcc;
326 327
327 /* OAM F5 end-to-end */ 328 /* OAM F5 end-to-end */
328 if (pti == ATM_PTI_E2EF5) { 329 if (pti == ATM_PTI_E2EF5) {
@@ -331,7 +332,7 @@ static void usbatm_extract_cells(struct usbatm_data *instance,
331 continue; 332 continue;
332 } 333 }
333 334
334 sarb = vcc_data->sarb; 335 sarb = cached_vcc->sarb;
335 336
336 if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) { 337 if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) {
337 atm_dbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n", 338 atm_dbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n",