This is a note to let you know that I've just added the patch titled

    USB: io_ti: fix sysfs-attribute creation

to my usb git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


>From 5d8c61bc283826827e1f06816c146bfc507d3834 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 18 Oct 2012 11:43:28 +0200
Subject: USB: io_ti: fix sysfs-attribute creation

Make sure port data is initialised before creating sysfs attributes to
avoid a race.

A recent patch ("USB: io_ti: fix port-data memory leak") got the
sysfs-attribute creation and port-data initialisation ordering wrong.

Cc: <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/serial/io_ti.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 9ae65d6..60023c2 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2578,13 +2578,6 @@ static int edge_port_probe(struct usb_serial_port *port)
                return -ENOMEM;
        }
 
-       ret = edge_create_sysfs_attrs(port);
-       if (ret) {
-               kfifo_free(&edge_port->write_fifo);
-               kfree(edge_port);
-               return ret;
-       }
-
        spin_lock_init(&edge_port->ep_lock);
        edge_port->port = port;
        edge_port->edge_serial = usb_get_serial_data(port->serial);
@@ -2592,6 +2585,13 @@ static int edge_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, edge_port);
 
+       ret = edge_create_sysfs_attrs(port);
+       if (ret) {
+               kfifo_free(&edge_port->write_fifo);
+               kfree(edge_port);
+               return ret;
+       }
+
        return 0;
 }
 
-- 
1.8.0.rc0.18.gf84667d


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

Reply via email to