提交 fe70dce9 编写于 作者: W Wei Yongjun 提交者: 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: NGrigor Tovmasyan <tovmasya@synopsys.com>
Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 5295322a
......@@ -147,8 +147,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册