aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ipw.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-10-25 09:42:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-25 12:39:37 -0400
commita997448c89905b80aa4022f734f03685e733d711 (patch)
tree2a672dee7be30a63ed74b549c9a0a188e3ecc763 /drivers/usb/serial/ipw.c
parent3eb55cc4ed88eee3b5230f66abcdbd2a91639eda (diff)
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: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ipw.c')
-rw-r--r--drivers/usb/serial/ipw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index add45b7d8aa7..4264821a3b34 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -203,8 +203,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
203 return 0; 203 return 0;
204} 204}
205 205
206/* fake probe - only to allocate data structures */ 206static int ipw_attach(struct usb_serial *serial)
207static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id)
208{ 207{
209 struct usb_wwan_intf_private *data; 208 struct usb_wwan_intf_private *data;
210 209
@@ -303,7 +302,7 @@ static struct usb_serial_driver ipw_device = {
303 .num_ports = 1, 302 .num_ports = 1,
304 .open = ipw_open, 303 .open = ipw_open,
305 .close = ipw_close, 304 .close = ipw_close,
306 .probe = ipw_probe, 305 .attach = ipw_attach,
307 .release = ipw_release, 306 .release = ipw_release,
308 .port_probe = usb_wwan_port_probe, 307 .port_probe = usb_wwan_port_probe,
309 .port_remove = usb_wwan_port_remove, 308 .port_remove = usb_wwan_port_remove,