From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwjTU-0002oU-Mz for qemu-devel@nongnu.org; Mon, 03 Sep 2018 03:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwjTR-0002u8-CL for qemu-devel@nongnu.org; Mon, 03 Sep 2018 03:40:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50598 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fwjTR-0002tk-4k for qemu-devel@nongnu.org; Mon, 03 Sep 2018 03:40:37 -0400 References: <20180830173657.22939-1-dgilbert@redhat.com> From: Thomas Huth Message-ID: <90c91534-ea52-42a8-0a01-5c8e5898b6d0@redhat.com> Date: Mon, 3 Sep 2018 09:40:34 +0200 MIME-Version: 1.0 In-Reply-To: <20180830173657.22939-1-dgilbert@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, quintela@redhat.com, cohuck@redhat.com, jemmy858585@gmail.com On 2018-08-30 19:36, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Clang correctly errors out moaning that rdma_return_path > is used uninitialised in the earlier error paths. > Make it NULL so that the error path ignores it. > > Fixes: 55cc1b5937a8e709e4c102e74b206281073aab82 > Signed-off-by: Dr. David Alan Gilbert > Reprorted by: Cornelia Huck > --- > migration/rdma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/migration/rdma.c b/migration/rdma.c > index ae07515e83..9b2e7e10aa 100644 > --- a/migration/rdma.c > +++ b/migration/rdma.c > @@ -4012,7 +4012,7 @@ static void rdma_accept_incoming_migration(void *opaque) > void rdma_start_incoming_migration(const char *host_port, Error **errp) > { > int ret; > - RDMAContext *rdma, *rdma_return_path; > + RDMAContext *rdma, *rdma_return_path = NULL; > Error *local_err = NULL; > > trace_rdma_start_incoming_migration(); This will silence the error from clang for sure, so: Reviewed-by: Thomas Huth But actually, the g_free(rdma_return_path); at the end of the function is dead code, since it will always be called with rdma_return_path == NULL. Maybe we should rather remove that g_free() instead? Thomas