]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
usb: dwc2: pci: Fix error return code in dwc2_pci_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 28 Mar 2018 13:41:13 +0000 (13:41 +0000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 21 May 2018 07:36:14 +0000 (10:36 +0300)
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>
drivers/usb/dwc2/pci.c

index e9e26f021a8976fcc22383032859f753c717a54b..d257c541e51ba4e51530e5d8c3d1048794f5f013 100644 (file)
@@ -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) {