aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2017-09-19 19:33:56 -0400
committerJens Axboe <axboe@kernel.dk>2017-09-25 14:42:11 -0400
commit0c319d3a144d4b8f1ea2047fd614d2149b68f889 (patch)
treec5c1a848aad36b300c74be53c21190b3c6694b3b /drivers
parent3688feb582a1bc4e58ad50f5eccfdb90615de27b (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/target/fc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 6850672ad2a2..58e010bdda3e 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -783,6 +783,9 @@ nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport,
783 u16 qid = nvmet_fc_getqueueid(connection_id); 783 u16 qid = nvmet_fc_getqueueid(connection_id);
784 unsigned long flags; 784 unsigned long flags;
785 785
786 if (qid > NVMET_NR_QUEUES)
787 return NULL;
788
786 spin_lock_irqsave(&tgtport->lock, flags); 789 spin_lock_irqsave(&tgtport->lock, flags);
787 list_for_each_entry(assoc, &tgtport->assoc_list, a_list) { 790 list_for_each_entry(assoc, &tgtport->assoc_list, a_list) {
788 if (association_id == assoc->association_id) { 791 if (association_id == assoc->association_id) {