usb: fotg210-udc: fix error return code in fotg210_udc_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 30 Dec 2022 06:54:27 +0000 (14:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2023 08:12:31 +0000 (09:12 +0100)
commit1a5a23b9bdf6bde0e5185ca834ff6e806cc2aaaf
treeebf88ae91982b7158728a25f4f239f9f64329a0a
parent2de5bba5890f6604a997c75e754df8082386c9f7
usb: fotg210-udc: fix error return code in fotg210_udc_probe()

After commit  5f217ccd520f ("fotg210-udc: Support optional external PHY"),
the error code is re-assigned to 0 in fotg210_udc_probe(), if allocate or
map memory fails after the assignment, it can't return an error code. Set
the error code to -ENOMEM to fix this problem.

Fixes: 5f217ccd520f ("fotg210-udc: Support optional external PHY")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221230065427.944586-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/fotg210/fotg210-udc.c