Skip to content

Commit 66e8848

Browse files
JK Kimgregkh
authored andcommitted
nvme-pci: fix var. type for increasing cq_head
[ Upstream commit a0aac97 ] nvmeq->cq_head is compared with nvmeq->q_depth and changed the value and cq_phase for handling the next cq db. but, nvmeq->q_depth's type is u32 and max. value is 0x10000 when CQP.MSQE is 0xffff and io_queue_depth is 0x10000. current temp. variable for comparing with nvmeq->q_depth is overflowed when previous nvmeq->cq_head is 0xffff. in this case, nvmeq->cq_phase is not updated. so, fix data type for temp. variable to u32. Signed-off-by: JK Kim <jongkang.kim2@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9dc2c2b commit 66e8848

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/nvme/host/pci.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx)
10271027

10281028
static inline void nvme_update_cq_head(struct nvme_queue *nvmeq)
10291029
{
1030-
u16 tmp = nvmeq->cq_head + 1;
1030+
u32 tmp = nvmeq->cq_head + 1;
10311031

10321032
if (tmp == nvmeq->q_depth) {
10331033
nvmeq->cq_head = 0;

0 commit comments

Comments
 (0)