staging: usbip: fix memory leak
authorKulikov Vasiliy <segooon@gmail.com>
Mon, 12 Jul 2010 14:48:46 +0000 (18:48 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Jul 2010 18:33:49 +0000 (11:33 -0700)
sdev should be freed if stub_add_files() failed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/usbip/stub_dev.c

index 3f95605427a7447c92ebd2e2b95d7600adafa20e..1f408511692748efd19dce9e7101449d42786e21 100644 (file)
@@ -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;
        }