From: Kulikov Vasiliy Date: Wed, 11 Aug 2010 08:02:10 +0000 (+0400) Subject: staging: usbip: fix memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2c6a66a51da4d7311aa4508c1cd56c2397cf708;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index b6b753a49346..b186b5fed2b9 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, if (busid_priv->status == STUB_BUSID_ALLOC) { - busid_priv->interf_count++; sdev = busid_priv->sdev; if (!sdev) return -ENODEV; + busid_priv->interf_count++; dev_info(&interface->dev, "USB/IP Stub: register a new interface " "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum,