Commit c2c6a66a authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

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: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 21167399
...@@ -427,11 +427,11 @@ static int stub_probe(struct usb_interface *interface, ...@@ -427,11 +427,11 @@ static int stub_probe(struct usb_interface *interface,
if (busid_priv->status == STUB_BUSID_ALLOC) { if (busid_priv->status == STUB_BUSID_ALLOC) {
busid_priv->interf_count++;
sdev = busid_priv->sdev; sdev = busid_priv->sdev;
if (!sdev) if (!sdev)
return -ENODEV; return -ENODEV;
busid_priv->interf_count++;
dev_info(&interface->dev, dev_info(&interface->dev,
"USB/IP Stub: register a new interface " "USB/IP Stub: register a new interface "
"(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment