]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: pci: prevent memory leak in dwc3_pci_probe
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Mon, 30 Sep 2019 02:41:45 +0000 (21:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:27:57 +0000 (19:27 +0100)
commit65b4a421e657ed09d3585a5bf75d4b2625aa1ba6
tree4fc0867f7ea2d95551c8825bd0bb18eccf8e6d72
parentced537d6e7947aafca457ac858b35669c7ab0037
usb: dwc3: pci: prevent memory leak in dwc3_pci_probe

[ Upstream commit 9bbfceea12a8f145097a27d7c7267af25893c060 ]

In dwc3_pci_probe a call to platform_device_alloc allocates a device
which is correctly put in case of error except one case: when the call to
platform_device_add_properties fails it directly returns instead of
going to error handling. This commit replaces return with the goto.

Fixes: 1a7b12f69a94 ("usb: dwc3: pci: Supply device properties via driver data")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/dwc3-pci.c