diff options
Diffstat (limited to 'drivers/usb/serial/usb_wwan.c')
-rw-r--r-- | drivers/usb/serial/usb_wwan.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 640fe0173236..b078440e822f 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
@@ -466,6 +466,9 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | |||
466 | int err; | 466 | int err; |
467 | int i; | 467 | int i; |
468 | 468 | ||
469 | if (!port->bulk_in_size || !port->bulk_out_size) | ||
470 | return -ENODEV; | ||
471 | |||
469 | portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); | 472 | portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
470 | if (!portdata) | 473 | if (!portdata) |
471 | return -ENOMEM; | 474 | return -ENOMEM; |
@@ -473,9 +476,6 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | |||
473 | init_usb_anchor(&portdata->delayed); | 476 | init_usb_anchor(&portdata->delayed); |
474 | 477 | ||
475 | for (i = 0; i < N_IN_URB; i++) { | 478 | for (i = 0; i < N_IN_URB; i++) { |
476 | if (!port->bulk_in_size) | ||
477 | break; | ||
478 | |||
479 | buffer = (u8 *)__get_free_page(GFP_KERNEL); | 479 | buffer = (u8 *)__get_free_page(GFP_KERNEL); |
480 | if (!buffer) | 480 | if (!buffer) |
481 | goto bail_out_error; | 481 | goto bail_out_error; |
@@ -489,9 +489,6 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | |||
489 | } | 489 | } |
490 | 490 | ||
491 | for (i = 0; i < N_OUT_URB; i++) { | 491 | for (i = 0; i < N_OUT_URB; i++) { |
492 | if (!port->bulk_out_size) | ||
493 | break; | ||
494 | |||
495 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); | 492 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); |
496 | if (!buffer) | 493 | if (!buffer) |
497 | goto bail_out_error2; | 494 | goto bail_out_error2; |