Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp540662imm; Wed, 1 Aug 2018 00:46:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSaKOaaSpb1VHmFH7b8BPxLu5tEcEj+WzqhqODoS8Yl47BxVeHRcIRh8pfcU8zBXkGk0kL X-Received: by 2002:a63:7e1a:: with SMTP id z26-v6mr23601374pgc.278.1533109598709; Wed, 01 Aug 2018 00:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533109598; cv=none; d=google.com; s=arc-20160816; b=KpRgxeONVnFwRRSpIWU5zUxqus7V3ahoa6x6MMP1q/mpkosecpxDUa1H4VUPGm0b08 auLVv4oHndQkqYKRE8KseOvJSYvIakM6FtuACVKIHWVFp3+HOxM53+QlY9D9ep56Nq/e Q4CJhKiF5dkcBb8prPmDZrQIRG4M8qdp/miyfJr1qb56UXDddxn4X73t+NnFh1++FMZC lmq5pXOrshhB7uO6O4HctkzMakBu9CILGOu2rDbZkQplCfk1JKRD/jgDnuJsDdHrAAr3 2BMfdw0dsIOxm73tAZXxaI0izGNIlZq7aS0JsrgI/YpaTXBdqINGyfEvEpc2QdxDeeU5 7+Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:date:message-id:subject:from:cc:to :arc-authentication-results; bh=RBPVKgIhi4G3EEidSoYqXDoVEdehcnaiK8Fzgor7WGQ=; b=mkByD0jkms17jBNd2tItZsH6458az7J7/Grw47UaFAJXST/fUQz8f1eddQn99DYZc7 vl99wyvW5w2oWujtJl6sCroWhEVw4K2Ksg5ZFQbASxLe1YZSDyEjBEBgDo+/PUEbVpEq GRjMQ12Hxrd5xFxQadeBoqzO3+AT0jGCdhiqwHSNpWwLdI13705N2WVMbyzLdqDSZ6w+ tfHfDiRZ58/n9D1ZuZj3HIX7fcWMEVBO2NigvhcyesaS7bMMgF3El6BZkRnod1rs/L8u ZSkvbQF4bDe70KcqJXysYKNKVJdFy02rev8YtVwkY6ASOJCw3x9DIvolQLtdQIfrmzJM hDrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j135-v6si17395576pfd.207.2018.08.01.00.46.24; Wed, 01 Aug 2018 00:46:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387628AbeHAJ3v (ORCPT + 99 others); Wed, 1 Aug 2018 05:29:51 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10205 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387411AbeHAJ3v (ORCPT ); Wed, 1 Aug 2018 05:29:51 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 71FD99F0507B9; Wed, 1 Aug 2018 15:45:22 +0800 (CST) Received: from [10.177.253.249] (10.177.253.249) by smtp.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.399.0; Wed, 1 Aug 2018 15:45:22 +0800 To: Dominique Martinet CC: "akpm@linux-foundation.org" , "Eric Van Hensbergen" , Ron Minnich , "Latchesar Ionkov" , Linux Kernel Mailing List , , "Greg Kurz" From: piaojun Subject: [PATCH] net/9p/trans_virtio.c: add a terminal char for mount tag Message-ID: <5B6164F6.60004@huawei.com> Date: Wed, 1 Aug 2018 15:44:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.253.249] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; --