[SCSI] mpt2sas: fix the incorrect scsi_dma_map error checking
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tue, 9 Mar 2010 02:09:50 +0000 (11:09 +0900)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 11 Apr 2010 14:23:26 +0000 (09:23 -0500)
scsi_dma_map() returns -1 if an error occurred (zero means that the
command has no data). So the following current code can't catch an
error:

sges_left = scsi_dma_map(scmd);
if (!sges_left) {
sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
" failed: request for %d bytes!\n", scsi_bufflen(scmd));
return -ENOMEM;
}

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

No differences found