From 47c7157f3406e83648dad1c5c4e6e8c0f574dfc3 Mon Sep 17 00:00:00 2001 From: Kulikov Vasiliy Date: Mon, 12 Jul 2010 18:48:46 +0400 Subject: [PATCH] staging: usbip: fix memory leak sdev should be freed if stub_add_files() failed. Signed-off-by: Kulikov Vasiliy Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/stub_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index 3f95605427a7..1f4085116927 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c @@ -438,6 +438,8 @@ static int stub_probe(struct usb_interface *interface, if (err) { dev_err(&interface->dev, "create sysfs files for %s\n", udev_busid); + usb_set_intfdata(interface, 0); + stub_device_free(sdev); return err; }