[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5B6164F6.60004@huawei.com>
Date: Wed, 1 Aug 2018 15:44:54 +0800
From: piaojun <piaojun@...wei.com>
To: Dominique Martinet <asmadeus@...ewreck.org>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"Eric Van Hensbergen" <ericvh@...il.com>,
Ron Minnich <rminnich@...dia.gov>,
"Latchesar Ionkov" <lucho@...kov.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
<v9fs-developer@...ts.sourceforge.net>,
"Greg Kurz" <groug@...d.org>
Subject: [PATCH] net/9p/trans_virtio.c: add a terminal char for mount tag
chan->tag has no terminal char at last which will result in printing messy
code when debugging code. So we should add '\0' for tag.
Signed-off-by: Jun Piao <piaojun@...wei.com>
---
net/9p/trans_virtio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index d422bfc..49d71d6 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -585,7 +585,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
err = -EINVAL;
goto out_free_vq;
}
- tag = kmalloc(tag_len, GFP_KERNEL);
+ tag = kzalloc(tag_len + 1, GFP_KERNEL);
if (!tag) {
err = -ENOMEM;
goto out_free_vq;
--
Powered by blists - more mailing lists