[SCSI] ibmvscsi: Correct DMA mapping leak
authorRobert Jennings <rcj@linux.vnet.ibm.com>
Thu, 22 Jan 2009 19:40:09 +0000 (13:40 -0600)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 10 Feb 2009 16:15:17 +0000 (11:15 -0500)
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.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/ibmvscsi/ibmvscsi.c

index 74d07d1..c9aa761 100644 (file)
@@ -432,6 +432,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,
                                sdev_printk(KERN_ERR, cmd->device,
                                            "Can't allocate memory "
                                            "for indirect table\n");
+                       scsi_dma_unmap(cmd);
                        return 0;
                }
        }