]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single...
authorSreekanth Reddy <sreekanth.reddy@avagotech.com>
Tue, 30 Jun 2015 06:55:04 +0000 (12:25 +0530)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 27 Aug 2015 18:08:31 +0000 (11:08 -0700)
Added dma_mapping_error() API after mapping an address with dma_map_single()
API.  Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it
complains about mpt3sas driver not calling dma_mapping_error after mapping an
address with dma_map_single

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/mpt3sas/mpt3sas_transport.c

index 7a7aa68a3f5f5d5ac67f6c6f0397227199b79358..70fd019e7ee585c14deea0e4ec1ffcff66709f8e 100644 (file)
@@ -1964,7 +1964,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
        } else {
                dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio),
                    blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL);
-               if (!dma_addr_out) {
+               if (pci_dma_mapping_error(ioc->pdev, dma_addr_out)) {
                        pr_info(MPT3SAS_FMT "%s(): DMA Addr out = NULL\n",
                            ioc->name, __func__);
                        rc = -ENOMEM;
@@ -1986,7 +1986,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
        } else {
                dma_addr_in =  pci_map_single(ioc->pdev, bio_data(rsp->bio),
                    blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL);
-               if (!dma_addr_in) {
+               if (pci_dma_mapping_error(ioc->pdev, dma_addr_in)) {
                        pr_info(MPT3SAS_FMT "%s(): DMA Addr in = NULL\n",
                            ioc->name, __func__);
                        rc = -ENOMEM;