Skip to content

Commit

Permalink
scsi: qlogicpti: Fix dma_map_sg() check
Browse files Browse the repository at this point in the history
Add missing error check for dma_map_sg().

Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: [email protected]
Cc: [email protected]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jack Wang <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
jinpuwang authored and martinkpetersen committed Sep 7, 2022
1 parent 68a3a91 commit 9806d1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/qlogicpti.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9806d1b

Please sign in to comment.