lpfc: Fix scsi prep dma buf error.
authorJames Smart <james.smart@avagotech.com>
Fri, 22 May 2015 14:42:39 +0000 (10:42 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Sat, 13 Jun 2015 15:22:04 +0000 (08:22 -0700)
Didn't check for less-than-or-equal zero. Means we may later call
scsi_dma_unmap() even though we don't have valid mappings.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 4a2a81875cfe1c207fa3825755d6b469294ae867..b3b195ff64fec79318a932ecb978f2554a7cf350 100644 (file)
@@ -3257,7 +3257,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
                 */
 
                nseg = scsi_dma_map(scsi_cmnd);
-               if (unlikely(!nseg))
+               if (unlikely(nseg <= 0))
                        return 1;
                sgl += 1;
                /* clear the last flag in the fcp_rsp map entry */