diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2009-01-22 22:45:38 +0100 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-25 15:14:53 +0100 |
commit | 64b840dd88eb2054f86c72ed6d989cb8681f0058 (patch) | |
tree | e6088041690abbd2fbf96fc8899dcd0620a60a38 /drivers/scsi/ibmvscsi | |
parent | [SCSI] qla2xxx: Update version number to 8.03.00-k2. (diff) | |
download | linux-64b840dd88eb2054f86c72ed6d989cb8681f0058.tar.xz linux-64b840dd88eb2054f86c72ed6d989cb8681f0058.zip |
[SCSI] ibmvfc: Fix DMA mapping leak on memory allocation failure
There is currently a DMA mapping leak that can occur in the ibmvfc
driver if we fail to allocate a scatterlist. Fix this by unmapping
the scatterlist in the failure path. Additionally, only log an error
for a scatterlist allocation failure if the log level is greater
than the default, since this can occur when running Active Memory
Sharing and this is not considered an error.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 91ef669d98f6..a1a511bdec8c 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1322,7 +1322,9 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd, &evt->ext_list_token); if (!evt->ext_list) { - scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n"); + scsi_dma_unmap(scmd); + if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL) + scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n"); return -ENOMEM; } } |