Skip to content

Commit

Permalink
fnic: pci_dma_mapping_error() doesn't return an error code
Browse files Browse the repository at this point in the history
pci_dma_mapping_error() returns true on error and false on success.

Fixes: fd6ddfa ('fnic: check pci_map_single() return value')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
Dan Carpenter authored and martinkpetersen committed Jul 21, 2016
1 parent de8c36b commit dd7328e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/scsi/fnic/fnic_fcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
skb_put(skb, len);
pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE);

r = pci_dma_mapping_error(fnic->pdev, pa);
if (r) {
if (pci_dma_mapping_error(fnic->pdev, pa)) {
r = -ENOMEM;
printk(KERN_ERR "PCI mapping failed with error %d\n", r);
goto free_skb;
}
Expand Down Expand Up @@ -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);

ret = pci_dma_mapping_error(fnic->pdev, pa);
if (ret) {
if (pci_dma_mapping_error(fnic->pdev, pa)) {
ret = -ENOMEM;
printk(KERN_ERR "DMA map failed with error %d\n", ret);
goto free_skb_on_err;
}
Expand Down

0 comments on commit dd7328e

Please sign in to comment.