mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
nvme: fix FDP fdpcidx bounds check
The fdpcidx bounds check sets n = NUMFDPC + 1 but used > instead of >=,
incorrectly accepting fdp_idx when it equals n (i.e. NUMFDPC + 1).
Fixes: 30b5f20bb2 ("nvme: register fdp parameters with the block layer")
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: liuxixin <gliuxen@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
8757fd9500
commit
0967074f68
|
|
@ -2261,7 +2261,7 @@ static int nvme_query_fdp_granularity(struct nvme_ctrl *ctrl,
|
|||
}
|
||||
|
||||
n = le16_to_cpu(h->numfdpc) + 1;
|
||||
if (fdp_idx > n) {
|
||||
if (fdp_idx >= n) {
|
||||
dev_warn(ctrl->device, "FDP index:%d out of range:%d\n",
|
||||
fdp_idx, n);
|
||||
/* Proceed without registering FDP streams */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user