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 <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Manohar Vanga 2011-02-23 14:25:28 +01:00 committed by Greg Kroah-Hartman
parent 6012795b13
commit da1bbd1d85

View file

@ -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);
}