[U-Boot] [PATCH 1/1] usb: xhci-exynos5: correct error checking

If fdtdec_next_compatible_subnode() fails it returns a negative value. The check (node <= 0) cannot identify this if node is unsigned.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- drivers/usb/host/xhci-exynos5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-exynos5.c b/drivers/usb/host/xhci-exynos5.c index 6f08d5d5a2..4cbfbdee3d 100644 --- a/drivers/usb/host/xhci-exynos5.c +++ b/drivers/usb/host/xhci-exynos5.c @@ -55,7 +55,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev) { struct exynos_xhci_platdata *plat = dev_get_platdata(dev); const void *blob = gd->fdt_blob; - unsigned int node; + int node; int depth;
/*

On Sun, Mar 18, 2018 at 8:51 PM, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
If fdtdec_next_compatible_subnode() fails it returns a negative value. The check (node <= 0) cannot identify this if node is unsigned.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
drivers/usb/host/xhci-exynos5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Mon, Mar 19, 2018 at 11:00 AM, Bin Meng bmeng.cn@gmail.com wrote:
On Sun, Mar 18, 2018 at 8:51 PM, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
If fdtdec_next_compatible_subnode() fails it returns a negative value. The check (node <= 0) cannot identify this if node is unsigned.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
drivers/usb/host/xhci-exynos5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
applied to u-boot-usb/topic-xhci, thanks!
participants (2)
-
Bin Meng
-
Heinrich Schuchardt