]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb/max3421: fix return error code in max3421_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 17 Nov 2020 06:15:00 +0000 (14:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:54 +0000 (11:25 +0100)
commitbe71c20adbda6fe360269a07705c779b199c0101
tree3d1599549a66b4eb521b5166fa8c2d2ea6b2590f
parent4055813c886f5c301e4032502eddda7c9f4eb1c3
usb/max3421: fix return error code in max3421_probe()

[ Upstream commit 5a569343e8a618dc73edebe0957eb42f2ab476bd ]

retval may be reassigned to 0 after max3421_of_vbus_en_pin(),
if allocate memory failed after this, max3421_probe() cann't
return ENOMEM, fix this by moving assign retval afther max3421_probe().

Fixes: 721fdc83b31b ("usb: max3421: Add devicetree support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20201117061500.3454223-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/max3421-hcd.c