Signed-off-by: Sarah Sharp <[EMAIL PROTECTED]>
---
 drivers/usb/serial/pl2303.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 8a36981..15097a4 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -693,7 +693,7 @@ static int pl2303_open(struct usb_serial_port *port, struct 
file *filp)
        struct ktermios tmp_termios;
        struct usb_serial *serial = port->serial;
        struct pl2303_private *priv = usb_get_serial_port_data(port);
-       unsigned char *buf;
+       unsigned char buf;
        int result;
 
        dbg("%s -  port %d", __FUNCTION__, port->number);
@@ -703,18 +703,14 @@ static int pl2303_open(struct usb_serial_port *port, 
struct file *filp)
                usb_clear_halt(serial->dev, port->read_urb->pipe);
        }
 
-       buf = kmalloc(10, GFP_KERNEL);
-       if (buf==NULL)
-               return -ENOMEM;
-
-       pl2303_vendor_read(0x8484, 0, serial, buf);
+       pl2303_vendor_read(0x8484, 0, serial, &buf);
        pl2303_vendor_write(0x0404, 0, serial);
-       pl2303_vendor_read(0x8484, 0, serial, buf);
-       pl2303_vendor_read(0x8383, 0, serial, buf);
-       pl2303_vendor_read(0x8484, 0, serial, buf);
+       pl2303_vendor_read(0x8484, 0, serial, &buf);
+       pl2303_vendor_read(0x8383, 0, serial, &buf);
+       pl2303_vendor_read(0x8484, 0, serial, &buf);
        pl2303_vendor_write(0x0404, 1, serial);
-       pl2303_vendor_read(0x8484, 0, serial, buf);
-       pl2303_vendor_read(0x8383, 0, serial, buf);
+       pl2303_vendor_read(0x8484, 0, serial, &buf);
+       pl2303_vendor_read(0x8383, 0, serial, &buf);
        pl2303_vendor_write(0, 1, serial);
        pl2303_vendor_write(1, 0, serial);
 
@@ -728,8 +724,6 @@ static int pl2303_open(struct usb_serial_port *port, struct 
file *filp)
                pl2303_vendor_write(2, 0x24, serial);
        }
 
-       kfree(buf);
-
        /* Setup termios */
        if (port->tty) {
                pl2303_set_termios(port, &tmp_termios);
-- 
1.5.3.1

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to