diff options
-rw-r--r-- | net/9p/trans_virtio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 36a1a739ad68..486df019f875 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -504,7 +504,10 @@ static ssize_t p9_mount_tag_show(struct device *dev, | |||
504 | vdev = dev_to_virtio(dev); | 504 | vdev = dev_to_virtio(dev); |
505 | chan = vdev->priv; | 505 | chan = vdev->priv; |
506 | 506 | ||
507 | return snprintf(buf, chan->tag_len + 1, "%s", chan->tag); | 507 | memcpy(buf, chan->tag, chan->tag_len); |
508 | buf[chan->tag_len] = 0; | ||
509 | |||
510 | return chan->tag_len + 1; | ||
508 | } | 511 | } |
509 | 512 | ||
510 | static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL); | 513 | static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL); |