Skip to contentSkip to conversation

bug in scsi debug code

PATCH New Rajagopal Ananthanarayanan 1 participant 1 message Feb 28, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bug in scsi debug code

A small fix in dump_stats() (scsi_merge.c) invoked when (struct req) has inconsistent number of segments. The list formed
by b_reqnext is null terminated, so the current code is simply wrong: it can cause a oops if (req->bh) is NULL, or it fails to print the last element in the b_reqnext chain.

Signature · 4 lines
--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
--------------------------------------------------------------------------
scsi/scsi_merge.c renamed from ../linux-2.4.2/linux/drivers/scsi/scsi_merge.c +1 -1
@@ -90,7 +90,7 @@
 	printk("nr_segments is %x\n", req->nr_segments);
 	printk("counted segments is %x\n", segments);
 	printk("Flags %d %d\n", use_clustering, dma_host);
-	for (bh = req->bh; bh->b_reqnext != NULL; bh = bh->b_reqnext) 
+	for (bh = req->bh; bh != NULL; bh = bh->b_reqnext)
 	{
 		printk("Segment 0x%p, blocks %d, addr 0x%lx\n",
 		       bh,