]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: core: Fix divide by zero in ufshcd_map_queues()
authorJinyoung Choi <j-young.choi@samsung.com>
Mon, 14 Feb 2022 10:33:52 +0000 (19:33 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 15 Feb 2022 03:10:29 +0000 (22:10 -0500)
commitc5bfacce93e9a99f102de1a3ff36a84b6c02bdaf
treec6e3f384f2310377748ff617eb534fb42f3a73d3
parentb3dc916630c01d2c9142ed6f220090139b82c26f
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 <bvanassche@acm.org>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c