Skip to content

Commit 10af115

Browse files
ychoijymartinkpetersen
authored andcommitted
scsi: ufs: core: Fix divide by zero in ufshcd_map_queues()
Before calling blk_mq_map_queues(), the mq_map and nr_queues belonging to struct blk_mq_queue_map must have a valid value. If nr_queues is set to 0, the system may encounter a divide by zero depending on the type of architecture. blk_mq_map_queues() -> queue_index() Link: https://lore.kernel.org/r/1891546521.01644873481638.JavaMail.epsvc@epcpadp4 Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Jinyoung Choi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 7f4c5a2 commit 10af115

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/ufs/ufshcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ static int ufshcd_map_queues(struct Scsi_Host *shost)
26812681
break;
26822682
case HCTX_TYPE_READ:
26832683
map->nr_queues = 0;
2684-
break;
2684+
continue;
26852685
default:
26862686
WARN_ON_ONCE(true);
26872687
}

0 commit comments

Comments
 (0)