Skip to content

Commit

Permalink
nvme: compare NQN string with right size
Browse files Browse the repository at this point in the history
Copy subnqns using NVMF_NQN_SIZE as it is < 256

Signed-off-by: Javier González <javier@cnexlabs.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Javier González authored and Jens Axboe committed Nov 11, 2017
1 parent 0c6af1c commit a47619b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ static void nvme_init_subnqn(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)

nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE);
if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) {
strcpy(ctrl->subnqn, id->subnqn);
strncpy(ctrl->subnqn, id->subnqn, NVMF_NQN_SIZE);
return;
}

Expand Down

0 comments on commit a47619b

Please sign in to comment.