Merge tag 'for-linus-4.1-merge-window' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / net / 9p / trans_virtio.c
index e62bcbbabb5e3cd43717f7980fce3e280aba3ded..9dd49ca67dbc22a905999de21b8355475ba40052 100644 (file)
@@ -525,7 +525,10 @@ static ssize_t p9_mount_tag_show(struct device *dev,
        vdev = dev_to_virtio(dev);
        chan = vdev->priv;
 
-       return snprintf(buf, chan->tag_len + 1, "%s", chan->tag);
+       memcpy(buf, chan->tag, chan->tag_len);
+       buf[chan->tag_len] = 0;
+
+       return chan->tag_len + 1;
 }
 
 static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL);