]> git.baikalelectronics.ru Git - kernel.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)
committerFelipe Balbi <balbi@kernel.org>
Sun, 27 Oct 2019 06:58:45 +0000 (08:58 +0200)
commita83ee0cb915b7beb369dae0de19e9d959b8f7a09
treedb49d1c0ee9ea11faa6691fc5daaa551143a1a95
parent7935f212e88c457dde7c75a747148b4b869c4607
usb: dwc3: pci: prevent memory leak in dwc3_pci_probe

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: 59e46d3529b1 ("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>
drivers/usb/dwc3/dwc3-pci.c