All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/9p/trans_virtio.c: add a terminal char for mount tag
@ 2018-08-01  7:44 piaojun
  2018-08-01  8:11 ` Dominique Martinet
  0 siblings, 1 reply; 6+ messages in thread
From: piaojun @ 2018-08-01  7:44 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: akpm, Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov,
	Linux Kernel Mailing List, v9fs-developer, Greg Kurz

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@huawei.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;
-- 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-02  1:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01  7:44 [PATCH] net/9p/trans_virtio.c: add a terminal char for mount tag piaojun
2018-08-01  8:11 ` Dominique Martinet
2018-08-01  8:24   ` piaojun
2018-08-01 10:52     ` Greg Kurz
2018-08-01 12:09       ` Dominique Martinet
2018-08-02  1:18         ` piaojun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.