diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-07-07 04:23:59 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-07-20 20:49:17 -0400 |
commit | dd7328e4c53649c1c7ec36bc1cf5b229b8662047 (patch) | |
tree | 93cd008337a84658cbef04b12dc76f266816edac | |
parent | de8c36bba33380fcc8564e69c039a4b84166e66d (diff) |
fnic: pci_dma_mapping_error() doesn't return an error code
pci_dma_mapping_error() returns true on error and false on success.
Fixes: fd6ddfa4c1dd ('fnic: check pci_map_single() return value')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/fnic/fnic_fcs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index 0d532ae273eb..3b7da66e2771 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c | |||
@@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq) | |||
954 | skb_put(skb, len); | 954 | skb_put(skb, len); |
955 | pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE); | 955 | pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE); |
956 | 956 | ||
957 | r = pci_dma_mapping_error(fnic->pdev, pa); | 957 | if (pci_dma_mapping_error(fnic->pdev, pa)) { |
958 | if (r) { | 958 | r = -ENOMEM; |
959 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); | 959 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); |
960 | goto free_skb; | 960 | goto free_skb; |
961 | } | 961 | } |
@@ -1093,8 +1093,8 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
1093 | 1093 | ||
1094 | pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); | 1094 | pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); |
1095 | 1095 | ||
1096 | ret = pci_dma_mapping_error(fnic->pdev, pa); | 1096 | if (pci_dma_mapping_error(fnic->pdev, pa)) { |
1097 | if (ret) { | 1097 | ret = -ENOMEM; |
1098 | printk(KERN_ERR "DMA map failed with error %d\n", ret); | 1098 | printk(KERN_ERR "DMA map failed with error %d\n", ret); |
1099 | goto free_skb_on_err; | 1099 | goto free_skb_on_err; |
1100 | } | 1100 | } |