Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: stm32: fix an error code in probe

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>

authored by

Dan Carpenter and committed by
Vinod Koul
f37722ac 9abf2313

+2
+2
drivers/phy/st/phy-stm32-usbphyc.c
··· 710 710 ret = of_property_read_u32(child, "reg", &index); 711 711 if (ret || index > usbphyc->nphys) { 712 712 dev_err(&phy->dev, "invalid reg property: %d\n", ret); 713 + if (!ret) 714 + ret = -EINVAL; 713 715 goto put_child; 714 716 } 715 717