Skip to content

Commit

Permalink
nvmet-fc: ensure target queue id within range.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jsmart-gh authored and axboe committed Sep 25, 2017
1 parent 3688feb commit 0c319d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nvme/target/fc.c
Expand Up @@ -783,6 +783,9 @@ nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport,
u16 qid = nvmet_fc_getqueueid(connection_id);
unsigned long flags;

if (qid > NVMET_NR_QUEUES)
return NULL;

spin_lock_irqsave(&tgtport->lock, flags);
list_for_each_entry(assoc, &tgtport->assoc_list, a_list) {
if (association_id == assoc->association_id) {
Expand Down

0 comments on commit 0c319d3

Please sign in to comment.