Skip to content

Commit

Permalink
lpfc: Fix scsi prep dma buf error.
Browse files Browse the repository at this point in the history
[ Upstream commit 5116fbf ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
  • Loading branch information
James Smart authored and Sasha Levin committed Sep 28, 2015
1 parent 573f4d6 commit cf76d3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3380,7 +3380,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 */
Expand Down

0 comments on commit cf76d3d

Please sign in to comment.