* [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
@ 2018-08-30 17:36 Dr. David Alan Gilbert (git)
2018-08-31 0:17 ` Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-08-30 17:36 UTC (permalink / raw)
To: qemu-devel, quintela, cohuck, jemmy858585
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
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 <dgilbert@redhat.com>
Reprorted by: Cornelia Huck <cohuck@redhat.com>
---
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();
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
2018-08-30 17:36 [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path Dr. David Alan Gilbert (git)
@ 2018-08-31 0:17 ` Philippe Mathieu-Daudé
2018-08-31 9:37 ` Dr. David Alan Gilbert
2018-08-31 8:20 ` Juan Quintela
2018-09-03 7:40 ` Thomas Huth
2 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-08-31 0:17 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git), qemu-devel, quintela, cohuck, jemmy858585
On 8/30/18 2:36 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> 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 <dgilbert@redhat.com>
> Reprorted by: Cornelia Huck <cohuck@redhat.com>
"Reported-by"
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> 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();
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
2018-08-30 17:36 [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path Dr. David Alan Gilbert (git)
2018-08-31 0:17 ` Philippe Mathieu-Daudé
@ 2018-08-31 8:20 ` Juan Quintela
2018-09-03 7:40 ` Thomas Huth
2 siblings, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2018-08-31 8:20 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, cohuck, jemmy858585
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> 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 <dgilbert@redhat.com>
> Reprorted by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
queued
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
2018-08-31 0:17 ` Philippe Mathieu-Daudé
@ 2018-08-31 9:37 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2018-08-31 9:37 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, quintela, cohuck, jemmy858585
* Philippe Mathieu-Daudé (f4bug@amsat.org) wrote:
> On 8/30/18 2:36 PM, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > 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 <dgilbert@redhat.com>
> > Reprorted by: Cornelia Huck <cohuck@redhat.com>
>
> "Reported-by"
Oops
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Thanks,
Dave
>
> > ---
> > 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();
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
2018-08-30 17:36 [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path Dr. David Alan Gilbert (git)
2018-08-31 0:17 ` Philippe Mathieu-Daudé
2018-08-31 8:20 ` Juan Quintela
@ 2018-09-03 7:40 ` Thomas Huth
2018-09-03 12:17 ` Dr. David Alan Gilbert
2 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2018-09-03 7:40 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git), qemu-devel, quintela, cohuck, jemmy858585
On 2018-08-30 19:36, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> 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 <dgilbert@redhat.com>
> Reprorted by: Cornelia Huck <cohuck@redhat.com>
> ---
> 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 <thuth@redhat.com>
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path
2018-09-03 7:40 ` Thomas Huth
@ 2018-09-03 12:17 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2018-09-03 12:17 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, quintela, cohuck, jemmy858585
* Thomas Huth (thuth@redhat.com) wrote:
> On 2018-08-30 19:36, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > 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 <dgilbert@redhat.com>
> > Reprorted by: Cornelia Huck <cohuck@redhat.com>
> > ---
> > 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 <thuth@redhat.com>
>
> 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?
It's nice keeping the rdma/rdma_return_path semetric there so that if
we add other code into it the err path still cleans up.
Dave
> Thomas
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-03 12:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 17:36 [Qemu-devel] [PATCH] migration/rdma: Fix uninitialised rdma_return_path Dr. David Alan Gilbert (git)
2018-08-31 0:17 ` Philippe Mathieu-Daudé
2018-08-31 9:37 ` Dr. David Alan Gilbert
2018-08-31 8:20 ` Juan Quintela
2018-09-03 7:40 ` Thomas Huth
2018-09-03 12:17 ` Dr. David Alan Gilbert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.