aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/trans_virtio.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/9p/trans_virtio.c')
-rw-r--r--net/9p/trans_virtio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index e62bcbbabb5e..9dd49ca67dbc 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -525,7 +525,10 @@ static ssize_t p9_mount_tag_show(struct device *dev,
525 vdev = dev_to_virtio(dev); 525 vdev = dev_to_virtio(dev);
526 chan = vdev->priv; 526 chan = vdev->priv;
527 527
528 return snprintf(buf, chan->tag_len + 1, "%s", chan->tag); 528 memcpy(buf, chan->tag, chan->tag_len);
529 buf[chan->tag_len] = 0;
530
531 return chan->tag_len + 1;
529} 532}
530 533
531static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL); 534static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL);