Commit a997448c authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: ipw: fix interface-data memory leak in error path

Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3eb55cc4
...@@ -203,8 +203,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -203,8 +203,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
return 0; return 0;
} }
/* fake probe - only to allocate data structures */ static int ipw_attach(struct usb_serial *serial)
static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id)
{ {
struct usb_wwan_intf_private *data; struct usb_wwan_intf_private *data;
...@@ -303,7 +302,7 @@ static struct usb_serial_driver ipw_device = { ...@@ -303,7 +302,7 @@ static struct usb_serial_driver ipw_device = {
.num_ports = 1, .num_ports = 1,
.open = ipw_open, .open = ipw_open,
.close = ipw_close, .close = ipw_close,
.probe = ipw_probe, .attach = ipw_attach,
.release = ipw_release, .release = ipw_release,
.port_probe = usb_wwan_port_probe, .port_probe = usb_wwan_port_probe,
.port_remove = usb_wwan_port_remove, .port_remove = usb_wwan_port_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment