Commit 7c594bbd authored by Miklos Szeredi's avatar Miklos Szeredi

virtiofs: use strscpy for copying the queue name

Always null terminate fsvq->name.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: b43b7e81 ("virtiofs: provide a helper function for virtqueue initialization")
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent a390ccb3
...@@ -649,7 +649,7 @@ static void virtio_fs_vq_done(struct virtqueue *vq) ...@@ -649,7 +649,7 @@ static void virtio_fs_vq_done(struct virtqueue *vq)
static void virtio_fs_init_vq(struct virtio_fs_vq *fsvq, char *name, static void virtio_fs_init_vq(struct virtio_fs_vq *fsvq, char *name,
int vq_type) int vq_type)
{ {
strncpy(fsvq->name, name, VQ_NAME_LEN); strscpy(fsvq->name, name, VQ_NAME_LEN);
spin_lock_init(&fsvq->lock); spin_lock_init(&fsvq->lock);
INIT_LIST_HEAD(&fsvq->queued_reqs); INIT_LIST_HEAD(&fsvq->queued_reqs);
INIT_LIST_HEAD(&fsvq->end_reqs); INIT_LIST_HEAD(&fsvq->end_reqs);
......
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