From: Johan Hovold Date: Thu, 25 Oct 2012 13:42:39 +0000 (+0200) Subject: USB: ipw: fix interface-data memory leak in error path X-Git-Tag: v3.6.5~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e830d9c15b2b6cbc557d213c52f8d1835002c66f;p=thirdparty%2Fkernel%2Fstable.git USB: ipw: fix interface-data memory leak in error path commit a997448c89905b80aa4022f734f03685e733d711 upstream. Move interface data allocation to attach so that it is deallocated should usb-serial probe fail. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index dfaf7f1a475b2..8df011f8988cd 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -209,8 +209,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port) return 0; } -/* fake probe - only to allocate data structures */ -static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id) +static int ipw_attach(struct usb_serial *serial) { struct usb_wwan_intf_private *data; @@ -310,7 +309,7 @@ static struct usb_serial_driver ipw_device = { .num_ports = 1, .open = ipw_open, .close = ipw_close, - .probe = ipw_probe, + .attach = ipw_attach, .release = ipw_release, .port_probe = usb_wwan_port_probe, .port_remove = usb_wwan_port_remove,