]> git.baikalelectronics.ru Git - kernel.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>
Fri, 25 Nov 2022 16:42:03 +0000 (17:42 +0100)
commiteeacab45fc2eac7dc75b09e6cd48abff7270ee69
treea179c650c1f3c2ad2bf0b90b37859ebe609efc21
parent8289493f8553c77552e2f4bb95ee40fa05d0eace
phy: stm32: fix an error code in probe

[ Upstream commit 0093973eec7cab60103f121a896c251692543a9c ]

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

Fixes: 833c26d115b1 ("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