Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {