Skip to contentSkip to conversation

xhci-ext-caps.c: Add missing platform_device_put() on error in xhci_create_intel_xhci_

PATCH New Wei Yongjun 1 participant 1 message Sep 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xhci-ext-caps.c: Add missing platform_device_put() on error in xhci_create_intel_xhci_

Add the missing platform_device_put() before return from xhci_create_intel_xhci_sw_pdev() in the error handling case.

Fixes 6ed151f26484 ("xhci-ext-caps.c: Add property to disable Intel SW switch")
---
 drivers/usb/host/xhci-ext-caps.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-ext-caps.c +1 -0
index f498160df969..3351d07c431f 100644
@@ -57,6 +57,7 @@ static int xhci_create_intel_xhci_sw_pdev(struct xhci_hcd *xhci, u32 cap_offset)
 		ret = platform_device_add_properties(pdev, role_switch_props);
 		if (ret) {
 			dev_err(dev, "failed to register device properties\n");
+			platform_device_put(pdev);
 			return ret;
 		}
 	}