Commit da1bbd1d authored by Manohar Vanga's avatar Manohar Vanga Committed by Greg Kroah-Hartman

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: default avatarManohar Vanga <manohar.vanga@cern.ch>
Acked-by: default avatarMartyn Welch <martyn.welch@ge.com>
Acked-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6012795b
...@@ -1364,7 +1364,7 @@ int vme_register_bridge(struct vme_bridge *bridge) ...@@ -1364,7 +1364,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
return retval; return retval;
err_reg: err_reg:
while (i > -1) { while (--i >= 0) {
dev = &bridge->dev[i]; dev = &bridge->dev[i];
device_unregister(dev); device_unregister(dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment