Skip to content

Commit 0c319d3

Browse files
jsmart-ghaxboe
authored andcommitted
nvmet-fc: ensure target queue id within range.
When searching for queue id's ensure they are within the expected range. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3688feb commit 0c319d3

File tree

1 file changed

+3
-0
lines changed
  • drivers/nvme/target

1 file changed

+3
-0
lines changed

Diff for: drivers/nvme/target/fc.c

+3
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,9 @@ nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport,
783783
u16 qid = nvmet_fc_getqueueid(connection_id);
784784
unsigned long flags;
785785

786+
if (qid > NVMET_NR_QUEUES)
787+
return NULL;
788+
786789
spin_lock_irqsave(&tgtport->lock, flags);
787790
list_for_each_entry(assoc, &tgtport->assoc_list, a_list) {
788791
if (association_id == assoc->association_id) {

0 commit comments

Comments
 (0)