[PATCH 543/961] staging: vme: fix loop condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Manohar Vanga <manohar.vanga@xxxxxxx>

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@xxxxxxx>
Acked-by: Martyn Welch <martyn.welch@xxxxxx>
Acked-by: Dan Carpenter <error27@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/vme/vme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 88bf455..c1ec230 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);
 	}
-- 
1.7.4.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux