summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-03-28 15:41:13 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-04-25 13:24:48 +0200
commita53097c2319c9df16dff6109392c50aa422265bf (patch)
tree27a8ca7e86b3f3546b307a709f014a94c745a983 /drivers
parentusb: dwc2: WA for Full speed ISOC IN in DDMA mode. (diff)
downloadlinux-a53097c2319c9df16dff6109392c50aa422265bf.tar.xz
linux-a53097c2319c9df16dff6109392c50aa422265bf.zip
usb: dwc2: pci: Fix error return code in dwc2_pci_probe()
Fix to return error code -ENOMEM from the alloc fail error handling case instead of 0, as done elsewhere in this function. Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe") Reviewed-by: Grigor Tovmasyan <tovmasya@synopsys.com> Acked-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc2/pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
index 7f21747007f1..bea2e8ec0369 100644
--- a/drivers/usb/dwc2/pci.c
+++ b/drivers/usb/dwc2/pci.c
@@ -141,8 +141,10 @@ static int dwc2_pci_probe(struct pci_dev *pci,
goto err;
glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
- if (!glue)
+ if (!glue) {
+ ret = -ENOMEM;
goto err;
+ }
ret = platform_device_add(dwc2);
if (ret) {