Fix two memory leaks involving dbgbuf that were introduced in port-probe
error paths when backporting the following port-data fixes from v3.7
(which doesn't have dbgbuf):

0978c94 USB: iuu_phoenix: fix sysfs-attribute creation
5363655 USB: iuu_phoenix: fix port-data memory leak

Reported-by: Fengguang Wu <fengguang...@intel.com>
Cc: stable <sta...@vger.kernel.org>
Signed-off-by: Johan Hovold <jhov...@gmail.com>

---

As was discussed off-list, these these two issues are present in v3.6.y.

Thanks,
Johan


 drivers/usb/serial/iuu_phoenix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index cdf0f99..8d3692b 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -105,7 +105,7 @@ static int iuu_port_probe(struct usb_serial_port *port)
        }
 
        priv->dbgbuf = kzalloc(256, GFP_KERNEL);
-       if (!priv->writebuf) {
+       if (!priv->dbgbuf) {
                kfree(priv->writebuf);
                kfree(priv->buf);
                kfree(priv);
@@ -120,6 +120,7 @@ static int iuu_port_probe(struct usb_serial_port *port)
 
        ret = iuu_create_sysfs_attrs(port);
        if (ret) {
+               kfree(priv->dbgbuf);
                kfree(priv->writebuf);
                kfree(priv->buf);
                kfree(priv);
-- 
1.7.12.4

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

Reply via email to