diff options
-rw-r--r-- | drivers/scsi/hpsa.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index a7c3d4711535..7f4f790a3d71 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3014,6 +3014,13 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) | |||
3014 | if (iocommand.buf_size > 0) { | 3014 | if (iocommand.buf_size > 0) { |
3015 | temp64.val = pci_map_single(h->pdev, buff, | 3015 | temp64.val = pci_map_single(h->pdev, buff, |
3016 | iocommand.buf_size, PCI_DMA_BIDIRECTIONAL); | 3016 | iocommand.buf_size, PCI_DMA_BIDIRECTIONAL); |
3017 | if (dma_mapping_error(&h->pdev->dev, temp64.val)) { | ||
3018 | c->SG[0].Addr.lower = 0; | ||
3019 | c->SG[0].Addr.upper = 0; | ||
3020 | c->SG[0].Len = 0; | ||
3021 | rc = -ENOMEM; | ||
3022 | goto out; | ||
3023 | } | ||
3017 | c->SG[0].Addr.lower = temp64.val32.lower; | 3024 | c->SG[0].Addr.lower = temp64.val32.lower; |
3018 | c->SG[0].Addr.upper = temp64.val32.upper; | 3025 | c->SG[0].Addr.upper = temp64.val32.upper; |
3019 | c->SG[0].Len = iocommand.buf_size; | 3026 | c->SG[0].Len = iocommand.buf_size; |
@@ -3135,6 +3142,15 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) | |||
3135 | for (i = 0; i < sg_used; i++) { | 3142 | for (i = 0; i < sg_used; i++) { |
3136 | temp64.val = pci_map_single(h->pdev, buff[i], | 3143 | temp64.val = pci_map_single(h->pdev, buff[i], |
3137 | buff_size[i], PCI_DMA_BIDIRECTIONAL); | 3144 | buff_size[i], PCI_DMA_BIDIRECTIONAL); |
3145 | if (dma_mapping_error(&h->pdev->dev, temp64.val)) { | ||
3146 | c->SG[i].Addr.lower = 0; | ||
3147 | c->SG[i].Addr.upper = 0; | ||
3148 | c->SG[i].Len = 0; | ||
3149 | hpsa_pci_unmap(h->pdev, c, i, | ||
3150 | PCI_DMA_BIDIRECTIONAL); | ||
3151 | status = -ENOMEM; | ||
3152 | goto cleanup1; | ||
3153 | } | ||
3138 | c->SG[i].Addr.lower = temp64.val32.lower; | 3154 | c->SG[i].Addr.lower = temp64.val32.lower; |
3139 | c->SG[i].Addr.upper = temp64.val32.upper; | 3155 | c->SG[i].Addr.upper = temp64.val32.upper; |
3140 | c->SG[i].Len = buff_size[i]; | 3156 | c->SG[i].Len = buff_size[i]; |