]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: stm32: fix an error code in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Oct 2022 09:25:06 +0000 (12:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:57:08 +0000 (09:57 +0100)
commit72ea2fc29962f3bb16eba80a2f0c88ffa6bb9e08
treebf3b589e5fd62fd55f979043da08aa625c372690
parent925bf1ba760482591218ace2c8fe135155da2710
phy: stm32: fix an error code in probe

[ Upstream commit ca1c73628f5bd0c1ef6e46073cc3be2450605b06 ]

If "index > usbphyc->nphys" is true then this returns success but it
should return -EINVAL.

Fixes: 94c358da3a05 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/Y0kq8j6S+5nDdMpr@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/st/phy-stm32-usbphyc.c