Skip to contentSkip to conversation

be2iscsi: Fixing Bug for multiple SGEs

PATCH In review Jayamohan Kallickal 1 participant 1 message Jan 6, 2010

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

PATCH 1/3 be2iscsi: Fixing Bug for multiple SGEs

The patch fixes a but where the sg_next is not assigned and hence
the first sge was being resused wrongly

---
 drivers/scsi/be2iscsi/be_main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/be2iscsi/be_main.c +3 -2
index 9fc4446..d611a13 100644
@@ -1711,7 +1711,8 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg,
 				      io_task->bhs_pa.u.a32.address_hi);
 
 	l_sg = sg;
-	for (index = 0; (index < num_sg) && (index < 2); index++, sg_next(sg)) {
+	for (index = 0; (index < num_sg) && (index < 2); index++,
+							 sg = sg_next(sg)) {
 		if (index == 0) {
 			sg_len = sg_dma_len(sg);
 			addr = (u64) sg_dma_address(sg);
@@ -1755,7 +1756,7 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg,
 	psgl++;
 	psgl++;
 	offset = 0;
-	for (index = 0; index < num_sg; index++, sg_next(sg), psgl++) {
+	for (index = 0; index < num_sg; index++, sg = sg_next(sg), psgl++) {
 		sg_len = sg_dma_len(sg);
 		addr = (u64) sg_dma_address(sg);
 		AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, psgl,
Signature · 1 line
1.6.4