diff options
author | Jack Wang <jinpu.wang@ionos.com> | 2022-08-26 13:14:35 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-09-07 05:14:14 +0300 |
commit | 9806d1b895f42c919620539b8e7621d73ea6d60d (patch) | |
tree | 11184c00d0a8f03d9d231305aa573ce8d914715c /drivers/scsi | |
parent | 68a3a9102a6891635fa7595ce78808e57b66fc6f (diff) | |
download | linux-9806d1b895f42c919620539b8e7621d73ea6d60d.tar.xz |
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.com
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qlogicpti.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index 57f2f4135a06..8c961ff03fcd 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -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; |