From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUXFC-00072M-Hx for qemu-devel@nongnu.org; Wed, 26 Aug 2015 05:43:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUXF9-0004a4-CN for qemu-devel@nongnu.org; Wed, 26 Aug 2015 05:43:46 -0400 Received: from mga09.intel.com ([134.134.136.24]:33591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUXF9-0004Zm-64 for qemu-devel@nongnu.org; Wed, 26 Aug 2015 05:43:43 -0400 References: <1439563931-12352-1-git-send-email-guangrong.xiao@linux.intel.com> <1439563931-12352-7-git-send-email-guangrong.xiao@linux.intel.com> <20150825145702.GA8344@stefanha-thinkpad.redhat.com> From: Xiao Guangrong Message-ID: <55DD88F1.6010005@linux.intel.com> Date: Wed, 26 Aug 2015 17:37:53 +0800 MIME-Version: 1.0 In-Reply-To: <20150825145702.GA8344@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/18] pc: implement NVDIMM device abstract List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, rth@twiddle.net On 08/25/2015 10:57 PM, Stefan Hajnoczi wrote: > On Fri, Aug 14, 2015 at 10:51:59PM +0800, Xiao Guangrong wrote: >> +static void set_file(Object *obj, const char *str, Error **errp) >> +{ >> + PCNVDIMMDevice *nvdimm = PC_NVDIMM(obj); >> + >> + if (nvdimm->file) { >> + g_free(nvdimm->file); >> + } > > g_free(NULL) is a nop so it's safe to replace the if with just > g_free(nvdimm->file). > Yeah, the man page says you're right. Will clean it up.