aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx/aic79xx_osm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic7xxx/aic79xx_osm.c')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 72fccd9f40df..0081aa357c8b 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -1413,6 +1413,10 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1413 unsigned long flags; 1413 unsigned long flags;
1414 int nseg; 1414 int nseg;
1415 1415
1416 nseg = scsi_dma_map(cmd);
1417 if (nseg < 0)
1418 return SCSI_MLQUEUE_HOST_BUSY;
1419
1416 ahd_lock(ahd, &flags); 1420 ahd_lock(ahd, &flags);
1417 1421
1418 /* 1422 /*
@@ -1430,6 +1434,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1430 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) { 1434 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
1431 ahd->flags |= AHD_RESOURCE_SHORTAGE; 1435 ahd->flags |= AHD_RESOURCE_SHORTAGE;
1432 ahd_unlock(ahd, &flags); 1436 ahd_unlock(ahd, &flags);
1437 scsi_dma_unmap(cmd);
1433 return SCSI_MLQUEUE_HOST_BUSY; 1438 return SCSI_MLQUEUE_HOST_BUSY;
1434 } 1439 }
1435 1440
@@ -1485,8 +1490,6 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1485 ahd_set_sense_residual(scb, 0); 1490 ahd_set_sense_residual(scb, 0);
1486 scb->sg_count = 0; 1491 scb->sg_count = 0;
1487 1492
1488 nseg = scsi_dma_map(cmd);
1489 BUG_ON(nseg < 0);
1490 if (nseg > 0) { 1493 if (nseg > 0) {
1491 void *sg = scb->sg_list; 1494 void *sg = scb->sg_list;
1492 struct scatterlist *cur_seg; 1495 struct scatterlist *cur_seg;