summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/fabrics.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-05-25 11:04:03 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-25 16:50:12 +0200
commit1e5f44616287b24a2c032274d6a5e3690dfd279b (patch)
treeef5b1c612ab409bdc4345bb515259121f038d6f6 /drivers/nvme/host/fabrics.c
parentnvmet-loop: use nr_phys_segments when map rq to sgl (diff)
downloadlinux-1e5f44616287b24a2c032274d6a5e3690dfd279b.tar.xz
linux-1e5f44616287b24a2c032274d6a5e3690dfd279b.zip
nvme: fix KASAN warning when parsing host nqn
The host nqn actually is smaller than the space reserved for it, so we should be using strlcpy to keep KASAN happy. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/fabrics.c')
-rw-r--r--drivers/nvme/host/fabrics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 8cb3d73e957d..aa318136460e 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -57,7 +57,7 @@ static struct nvmf_host *nvmf_host_add(const char *hostnqn)
goto out_unlock;
kref_init(&host->ref);
- memcpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
+ strlcpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
list_add_tail(&host->list, &nvmf_hosts);
out_unlock: