diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 8cb3d73e957dbe15333ba42d833e3b292fe24f34..aa318136460ef91f9bfa5c804aa36f53740b35eb 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: