From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3A3238D3D for ; Mon, 19 Oct 2015 07:06:50 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 18 Oct 2015 22:06:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,700,1437462000"; d="scan'208";a="667020546" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 18 Oct 2015 22:06:31 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Oct 2015 22:06:31 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.106]) with mapi id 14.03.0248.002; Mon, 19 Oct 2015 13:06:29 +0800 From: "Xie, Huawei" To: Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 2/7] virtio: add software rx ring, fake_buf into virtqueue Thread-Index: AdEKK+j8PJNu9BpbSsmYKEvPpdhKvw== Date: Mon, 19 Oct 2015 05:06:28 +0000 Message-ID: References: <1443537953-23917-1-git-send-email-huawei.xie@intel.com> <1445149744-3217-1-git-send-email-huawei.xie@intel.com> <1445149744-3217-3-git-send-email-huawei.xie@intel.com> <20151018212012.3ba74f45@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 2/7] virtio: add software rx ring, fake_buf into virtqueue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 05:06:50 -0000 On 10/19/2015 12:20 PM, Stephen Hemminger wrote: On Sun, 18 Oct 2015 14:28:59 +0800 Huawei Xie wrote: + if (vq->sw_ring) + rte_free(vq->sw_ring); + Do not need to test for NULL before calling rte_free. Better to just rely on the fact that rte_free(NULL) is documented to be ok (no operation). ok, btw, in previous commit, just in the same function, void virtio_dev_queue_release(vq) [...] rte_free(vq); vq =3D NULL; I think there is no need to set NULL to vq. Will submit a patch to fix it i= f you agree.