X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fusb%2Fserial%2Fiuu_phoenix.c;h=418a4e33a68b43231259c97f67e5ff7464cbfed6;hp=6aca631a407aa0891492b12c05259e4618ad333e;hb=c7f74e5085ca9c8344cb62b88ad35e36900671ea;hpb=aa2dfb372a2a647beedac163ce6f8b0fcbefac29 diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 6aca631a407a..418a4e33a68b 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c @@ -112,7 +112,12 @@ static int iuu_alloc_buf(struct iuu_private *priv) static int iuu_startup(struct usb_serial *serial) { + unsigned char num_ports = serial->num_ports; struct iuu_private *priv; + + if (serial->num_bulk_in < num_ports || serial->num_bulk_out < num_ports) + return -ENODEV; + priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL); dbg("%s- priv allocation success", __func__); if (!priv) @@ -327,7 +332,7 @@ static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count) usb_bulk_msg(serial->dev, usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress), buf, - count, &actual, HZ * 1); + count, &actual, 1000); if (status != IUU_OPERATION_OK) dbg("%s - error = %2x", __func__, status); @@ -350,7 +355,7 @@ static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count) usb_bulk_msg(serial->dev, usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), buf, - count, &actual, HZ * 1); + count, &actual, 1000); if (status != IUU_OPERATION_OK) dbg("%s - error = %2x", __func__, status);