Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124678
b: refs/heads/master
c: 20c09df
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Dec 29, 2008
1 parent 9023d1c commit cd9da76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2131b33c7e07c2905ee2f2321cc4dae1928c483
refs/heads/master: 20c09df7eb9c92a40e0ecf654b6e8f14c8583b9e
15 changes: 12 additions & 3 deletions trunk/drivers/scsi/eata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,8 +1626,15 @@ static void map_dma(unsigned int i, struct hostdata *ha)

cpp->sense_len = SCSI_SENSE_BUFFERSIZE;

count = scsi_dma_map(SCpnt);
BUG_ON(count < 0);
if (!scsi_sg_count(SCpnt)) {
cpp->data_len = 0;
return;
}

count = pci_map_sg(ha->pdev, scsi_sglist(SCpnt), scsi_sg_count(SCpnt),
pci_dir);
BUG_ON(!count);

scsi_for_each_sg(SCpnt, sg, count, k) {
cpp->sglist[k].address = H2DEV(sg_dma_address(sg));
cpp->sglist[k].num_bytes = H2DEV(sg_dma_len(sg));
Expand Down Expand Up @@ -1655,7 +1662,9 @@ static void unmap_dma(unsigned int i, struct hostdata *ha)
pci_unmap_single(ha->pdev, DEV2H(cpp->sense_addr),
DEV2H(cpp->sense_len), PCI_DMA_FROMDEVICE);

scsi_dma_unmap(SCpnt);
if (scsi_sg_count(SCpnt))
pci_unmap_sg(ha->pdev, scsi_sglist(SCpnt), scsi_sg_count(SCpnt),
pci_dir);

if (!DEV2H(cpp->data_len))
pci_dir = PCI_DMA_BIDIRECTIONAL;
Expand Down

0 comments on commit cd9da76

Please sign in to comment.