diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-03-28 13:41:13 +0000 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-05-21 10:36:14 +0300 |
commit | fe70dce97c1d8b4e5b2ea1d2396f3b78d29285bf (patch) | |
tree | 6b54612213600fd303f3a9cfde726d8ba13a04b7 /drivers/usb/dwc2 | |
parent | 5295322a069af309b8fd62dc923e5b407aa83688 (diff) | |
download | blackbird-obmc-linux-fe70dce97c1d8b4e5b2ea1d2396f3b78d29285bf.tar.gz blackbird-obmc-linux-fe70dce97c1d8b4e5b2ea1d2396f3b78d29285bf.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/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/pci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c index e9e26f021a89..d257c541e51b 100644 --- a/drivers/usb/dwc2/pci.c +++ b/drivers/usb/dwc2/pci.c @@ -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) { |