Commit 9806d1b8 authored by Jack Wang's avatar Jack Wang Committed by Martin K. Petersen

scsi: qlogicpti: Fix dma_map_sg() check

Add missing error check for dma_map_sg().

Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Link: https://lore.kernel.org/r/20220826101435.79170-1-jinpu.wang@ionos.comSigned-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 68a3a910
......@@ -909,7 +909,8 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
sg_count = dma_map_sg(&qpti->op->dev, sg,
scsi_sg_count(Cmnd),
Cmnd->sc_data_direction);
if (!sg_count)
return -1;
ds = cmd->dataseg;
cmd->segment_cnt = sg_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment