Commit 07dc7252 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

fnic: pci_dma_mapping_error() doesn't return an error code

commit dd7328e4 upstream.

pci_dma_mapping_error() returns true on error and false on success.

Fixes: fd6ddfa4 ('fnic: check pci_map_single() return value')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d513077
...@@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq) ...@@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
skb_put(skb, len); skb_put(skb, len);
pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE); pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE);
r = pci_dma_mapping_error(fnic->pdev, pa); if (pci_dma_mapping_error(fnic->pdev, pa)) {
if (r) { r = -ENOMEM;
printk(KERN_ERR "PCI mapping failed with error %d\n", r); printk(KERN_ERR "PCI mapping failed with error %d\n", r);
goto free_skb; goto free_skb;
} }
...@@ -1093,8 +1093,8 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) ...@@ -1093,8 +1093,8 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp)
pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE);
ret = pci_dma_mapping_error(fnic->pdev, pa); if (pci_dma_mapping_error(fnic->pdev, pa)) {
if (ret) { ret = -ENOMEM;
printk(KERN_ERR "DMA map failed with error %d\n", ret); printk(KERN_ERR "DMA map failed with error %d\n", ret);
goto free_skb_on_err; goto free_skb_on_err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment