From da1bbd1d85ca4b68c58986f997f859327fd7f648 Mon Sep 17 00:00:00 2001 From: Manohar Vanga Date: Wed, 23 Feb 2011 14:25:28 +0100 Subject: [PATCH] staging: vme: fix loop condition Fix loop condition in vme_register_bridge that results in an infinite loop in the event that device_register fails. Signed-off-by: Manohar Vanga Acked-by: Martyn Welch Acked-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vme/vme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c index 88bf4552012..c1ec230f005 100644 --- a/drivers/staging/vme/vme.c +++ b/drivers/staging/vme/vme.c @@ -1364,7 +1364,7 @@ int vme_register_bridge(struct vme_bridge *bridge) return retval; err_reg: - while (i > -1) { + while (--i >= 0) { dev = &bridge->dev[i]; device_unregister(dev); } -- 2.39.5