Skip to contentSkip to conversation

ibmvscsi: Correct DMA mapping leak

PATCH In review Robert Jennings 2 participants 2 messages Jan 22, 2009 – Jan 28, 2009

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

PATCH 1/1 ibmvscsi: Correct DMA mapping leak

The ibmvscsi client driver is not unmapping the SCSI command after encountering a DMA mapping error while trying to map an indirect scattergather list for the event pool. This leads to a leak of DMA entitlement that could result in the device failing future DMA operations in a CMO environment.

---
 drivers/scsi/ibmvscsi/ibmvscsi.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -0
Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c
===================================================================
@@ -432,6 +432,7 @@ static int map_sg_data(struct scsi_cmnd 
 				sdev_printk(KERN_ERR, cmd->device,
 				            "Can't allocate memory "
 				            "for indirect table\n");
+			scsi_dma_unmap(cmd);
 			return 0;
 		}
 	}
#1 lore raw

Acked by: Brian King <[email protected]>

Quoted 27 lines · Robert Jennings

The ibmvscsi client driver is not unmapping the SCSI command after encountering a DMA mapping error while trying to map an indirect scattergather list for the event pool. This leads to a leak of DMA entitlement that could result in the device failing future DMA operations in a CMO environment.

---
 drivers/scsi/ibmvscsi/ibmvscsi.c |    1 +
 1 file changed, 1 insertion(+)

Index: b/drivers/scsi/ibmvscsi/ibmvscsi.c
===================================================================

drivers/scsi/ibmvscsi/ibmvscsi.c +1 -1
@@ -432,6 +432,7 @@ static int map_sg_data(struct scsi_cmnd 
 				sdev_printk(KERN_ERR, cmd->device,
 				            "Can't allocate memory "
 				            "for indirect table\n");
+			scsi_dma_unmap(cmd);
 			return 0;
 		}
 	}
--

To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Brian King
Linux on Power Virtualization
IBM Linux Technology Center