Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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,