SCSI: advansys: handle errors from scsi_dma_map()
Subsystems (3)
PATCH 1/2 SCSI: advansys: handle errors from scsi_dma_map()
scsi_dma_map() returns -ENOMEM on error.
Signed-off-by Dan Carpenter <[email protected]>
drivers/scsi/advansys.c +6 -0
@@ -8427,6 +8427,12 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,/* Build ASC_SCSI_Q */ use_sg =scsi_dma_map (scp); +if (use_sg <0 ) { +scsi_dma_unmap (scp); + scp->result =HOST_BYTE (DID_SOFT_ERROR ); +return ASC_ERROR ; + } +if (use_sg !=0 ) {int sgcnt;struct scatterlist *slp;