Commit a53097c2 authored by Wei Yongjun's avatar Wei Yongjun Committed by Felipe Balbi

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: ecd29dab ("usb: dwc2: pci: Handle error cleanup in probe")
Reviewed-by: default avatarGrigor Tovmasyan <tovmasya@synopsys.com>
Acked-by: default avatarMinas Harutyunyan <hminas@synopsys.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0ebf2a2c
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment