Commit a47619b5 authored by Javier González's avatar Javier González Committed by Jens Axboe

nvme: compare NQN string with right size

Copy subnqns using NVMF_NQN_SIZE as it is < 256
Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0c6af1cc
...@@ -1810,7 +1810,7 @@ static void nvme_init_subnqn(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) ...@@ -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); nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE);
if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) { if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) {
strcpy(ctrl->subnqn, id->subnqn); strncpy(ctrl->subnqn, id->subnqn, NVMF_NQN_SIZE);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment