]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: vme: fix loop condition
authorManohar Vanga <manohar.vanga@cern.ch>
Wed, 23 Feb 2011 13:25:28 +0000 (14:25 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Feb 2011 22:41:29 +0000 (14:41 -0800)
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>
drivers/staging/vme/vme.c

index 88bf455201259ebb99f901ffe638dde8b1a6cdc5..c1ec230f005a56ed06792c96c0351d700a4b48f9 100644 (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);
        }