From: Greg Kroah-Hartman Date: Wed, 24 Oct 2012 17:28:29 +0000 (-0700) Subject: 3.6-stable patches X-Git-Tag: v3.0.49~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de4dedb9f0daa35cb0ddb4109c7b8538938edb95;p=thirdparty%2Fkernel%2Fstable-queue.git 3.6-stable patches added patches: usb-iuu_phoenix-fix-sysfs-attribute-creation.patch --- diff --git a/queue-3.6/series b/queue-3.6/series index a51169541bf..078db074642 100644 --- a/queue-3.6/series +++ b/queue-3.6/series @@ -25,3 +25,4 @@ usb-cyberjack-fix-port-data-memory-leak.patch usb-musb-am35xx-drop-spurious-unplugging-a-device.patch usb-host-xhci-new-system-added-for-compliance-mode-patch-on-sn65lvpe502cp.patch usb-iuu_phoenix-fix-port-data-memory-leak.patch +usb-iuu_phoenix-fix-sysfs-attribute-creation.patch diff --git a/queue-3.6/usb-iuu_phoenix-fix-sysfs-attribute-creation.patch b/queue-3.6/usb-iuu_phoenix-fix-sysfs-attribute-creation.patch new file mode 100644 index 00000000000..c2a104ef3cb --- /dev/null +++ b/queue-3.6/usb-iuu_phoenix-fix-sysfs-attribute-creation.patch @@ -0,0 +1,73 @@ +From 0978c9499944d0670338fd048a3bdb1624dc66dc Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 18 Oct 2012 10:52:17 +0200 +Subject: USB: iuu_phoenix: fix sysfs-attribute creation + +From: Johan Hovold + +commit 0978c9499944d0670338fd048a3bdb1624dc66dc upstream. + +Make sure sysfs attributes are created at port probe. + +A recent patch ("USB: iuu_phoenix: fix port-data memory leak") removed +the sysfs-attribute creation by mistake. + +Reported-by: Yuanhan Liu +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/iuu_phoenix.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/drivers/usb/serial/iuu_phoenix.c ++++ b/drivers/usb/serial/iuu_phoenix.c +@@ -60,6 +60,8 @@ static int iuu_cardout; + static bool xmas; + static int vcc_default = 5; + ++static int iuu_create_sysfs_attrs(struct usb_serial_port *port); ++static int iuu_remove_sysfs_attrs(struct usb_serial_port *port); + static void read_rxcmd_callback(struct urb *urb); + + struct iuu_private { +@@ -83,6 +85,7 @@ struct iuu_private { + static int iuu_port_probe(struct usb_serial_port *port) + { + struct iuu_private *priv; ++ int ret; + + priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL); + if (!priv) +@@ -115,6 +118,14 @@ static int iuu_port_probe(struct usb_ser + + usb_set_serial_port_data(port, priv); + ++ ret = iuu_create_sysfs_attrs(port); ++ if (ret) { ++ kfree(priv->writebuf); ++ kfree(priv->buf); ++ kfree(priv); ++ return ret; ++ } ++ + return 0; + } + +@@ -122,6 +133,7 @@ static int iuu_port_remove(struct usb_se + { + struct iuu_private *priv = usb_get_serial_port_data(port); + ++ iuu_remove_sysfs_attrs(port); + kfree(priv->dbgbuf); + kfree(priv->writebuf); + kfree(priv->buf); +@@ -1221,8 +1233,6 @@ static struct usb_serial_driver iuu_devi + .num_ports = 1, + .bulk_in_size = 512, + .bulk_out_size = 512, +- .port_probe = iuu_create_sysfs_attrs, +- .port_remove = iuu_remove_sysfs_attrs, + .open = iuu_open, + .close = iuu_close, + .write = iuu_uart_write,