From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 2/7] virtio: add software rx ring, fake_buf into virtqueue Date: Sun, 18 Oct 2015 21:20:12 -0700 Message-ID: <20151018212012.3ba74f45@xeon-e3> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Huawei Xie Return-path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by dpdk.org (Postfix) with ESMTP id CC2858E6F for ; Mon, 19 Oct 2015 06:20:02 +0200 (CEST) Received: by padhk11 with SMTP id hk11so16811971pad.1 for ; Sun, 18 Oct 2015 21:20:02 -0700 (PDT) In-Reply-To: <1445149744-3217-3-git-send-email-huawei.xie@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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).