diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-08-11 04:02:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-31 17:51:52 -0400 |
commit | c2c6a66a51da4d7311aa4508c1cd56c2397cf708 (patch) | |
tree | a11dac74f2492a6faf1aeb71f271c97dd91250c2 /drivers/staging/usbip | |
parent | 211673991ec168c293791a94ad7aa31998907768 (diff) |
staging: usbip: fix memory leak
If stub_probe() failed then do not increase interf_count. In original
code sdev was leaked as its interf_count never reaches 0.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/stub_dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index b6b753a4934..b186b5fed2b 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c | |||
@@ -427,11 +427,11 @@ static int stub_probe(struct usb_interface *interface, | |||
427 | 427 | ||
428 | 428 | ||
429 | if (busid_priv->status == STUB_BUSID_ALLOC) { | 429 | if (busid_priv->status == STUB_BUSID_ALLOC) { |
430 | busid_priv->interf_count++; | ||
431 | sdev = busid_priv->sdev; | 430 | sdev = busid_priv->sdev; |
432 | if (!sdev) | 431 | if (!sdev) |
433 | return -ENODEV; | 432 | return -ENODEV; |
434 | 433 | ||
434 | busid_priv->interf_count++; | ||
435 | dev_info(&interface->dev, | 435 | dev_info(&interface->dev, |
436 | "USB/IP Stub: register a new interface " | 436 | "USB/IP Stub: register a new interface " |
437 | "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, | 437 | "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, |