Skip to contentSkip to conversation

mtip32xx: uninitialized variable in mtip_quiesce_io()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtip32xx: uninitialized variable in mtip_quiesce_io()

We recently introduce new continue in the loop which make gcc complain. In theory if MTIP_FLAG_SVC_THD_ACTIVE_BIT is set, we could hit continue over and over until eventually we time out of the loop. In that case "active" should be set as true, but right now it's uninitialized.

drivers/block/mtip32xx/mtip32xx.c +2 -1
index b5d843a..9bc10e3 100644
@@ -1026,7 +1026,8 @@ static void mtip_issue_non_ncq_command(struct mtip_port *port, int tag)
 static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout)
 {
 	unsigned long to;
-	unsigned int n, active;
+	unsigned int n;
+	unsigned int active = 1;
 
 	to = jiffies + msecs_to_jiffies(timeout);
 	do {
maintainer
#1 lore raw
Quoted 4 lines · Dan Carpenter

We recently introduce new continue in the loop which make gcc complain. In theory if MTIP_FLAG_SVC_THD_ACTIVE_BIT is set, we could hit continue over and over until eventually we time out of the loop. In that case "active" should be set as true, but right now it's uninitialized.

Thanks Dan, applied.

Signature · 1 line
Jens Axboe