diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-09 09:50:41 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:15:44 -0400 |
commit | 647b24256241e144fe8369244da1730b577211e9 (patch) | |
tree | 72b4d1426a8a2373c2c82fff54d7ae51ff6fa17c /drivers/scsi/aic7xxx/aic7xxx_osm.c | |
parent | ed5f606fef22e515331aab4c1f927775cf4af70e (diff) |
[SCSI] aic7xxx: fix IOMMU mapping failure handling
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 282aff6f852e..42ad48e09f02 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -1398,12 +1398,18 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev, | |||
1398 | return SCSI_MLQUEUE_DEVICE_BUSY; | 1398 | return SCSI_MLQUEUE_DEVICE_BUSY; |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | nseg = scsi_dma_map(cmd); | ||
1402 | if (nseg < 0) | ||
1403 | return SCSI_MLQUEUE_HOST_BUSY; | ||
1404 | |||
1401 | /* | 1405 | /* |
1402 | * Get an scb to use. | 1406 | * Get an scb to use. |
1403 | */ | 1407 | */ |
1404 | scb = ahc_get_scb(ahc); | 1408 | scb = ahc_get_scb(ahc); |
1405 | if (!scb) | 1409 | if (!scb) { |
1410 | scsi_dma_unmap(cmd); | ||
1406 | return SCSI_MLQUEUE_HOST_BUSY; | 1411 | return SCSI_MLQUEUE_HOST_BUSY; |
1412 | } | ||
1407 | 1413 | ||
1408 | scb->io_ctx = cmd; | 1414 | scb->io_ctx = cmd; |
1409 | scb->platform_data->dev = dev; | 1415 | scb->platform_data->dev = dev; |
@@ -1464,8 +1470,6 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev, | |||
1464 | ahc_set_sense_residual(scb, 0); | 1470 | ahc_set_sense_residual(scb, 0); |
1465 | scb->sg_count = 0; | 1471 | scb->sg_count = 0; |
1466 | 1472 | ||
1467 | nseg = scsi_dma_map(cmd); | ||
1468 | BUG_ON(nseg < 0); | ||
1469 | if (nseg > 0) { | 1473 | if (nseg > 0) { |
1470 | struct ahc_dma_seg *sg; | 1474 | struct ahc_dma_seg *sg; |
1471 | struct scatterlist *cur_seg; | 1475 | struct scatterlist *cur_seg; |