From: Wei Yongjun Date: Tue, 23 Jan 2018 09:35:14 +0000 (+0000) Subject: USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe() X-Git-Tag: v4.1.52~456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3d0bbef56a2e082dc9e0259b67967d0a0ba5acd;p=thirdparty%2Fkernel%2Fstable.git USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe() [ Upstream commit 8874ae5f15f3feef3b4a415b9aed51edcf449aa1 ] Add the missing platform_device_put() before return from bdc_pci_probe() in the platform_device_add_resources() error handling case. Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- diff --git a/drivers/usb/gadget/udc/bdc/bdc_pci.c b/drivers/usb/gadget/udc/bdc/bdc_pci.c index 02968842b359e..708e36f530d8d 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_pci.c +++ b/drivers/usb/gadget/udc/bdc/bdc_pci.c @@ -82,6 +82,7 @@ static int bdc_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) if (ret) { dev_err(&pci->dev, "couldn't add resources to bdc device\n"); + platform_device_put(bdc); return ret; }