* [PATCH] runstate: Initialize Error * to NULL
@ 2021-06-10 13:17 Peng Liang
2021-06-10 13:25 ` Daniel P. Berrangé
2021-06-10 13:41 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Peng Liang @ 2021-06-10 13:17 UTC (permalink / raw)
To: qemu-devel
Cc: philmd, alejandro.j.jimenez, laurent, xiexiangyou, armbru,
liangpeng10, pbonzini, alex.bennee
Based on the description of error_setg(), the local variable err in
qemu_init_subsystems() should be initialized to NULL.
Fix: efd7ab22fb "vl: extract qemu_init_subsystems"
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
---
The patch is generated by the following coccinelle script (thanks to
Markus):
@ r @
identifier id;
@@
(
static Error *id;
|
Error *id
+ = NULL
;
)
And exclude the modifications in softmmu/vl.c (which has fixed by
Zhenzhong Duan already) and util/error.c (which are unnecessary).
softmmu/runstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index ce8977c6a29c..54713100c2ea 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -746,7 +746,7 @@ static void qemu_run_exit_notifiers(void)
void qemu_init_subsystems(void)
{
- Error *err;
+ Error *err = NULL;
os_set_line_buffering();
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] runstate: Initialize Error * to NULL
2021-06-10 13:17 [PATCH] runstate: Initialize Error * to NULL Peng Liang
@ 2021-06-10 13:25 ` Daniel P. Berrangé
2021-06-10 13:41 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2021-06-10 13:25 UTC (permalink / raw)
To: Peng Liang
Cc: alex.bennee, alejandro.j.jimenez, armbru, xiexiangyou,
qemu-devel, pbonzini, philmd, laurent
On Thu, Jun 10, 2021 at 09:17:29PM +0800, Peng Liang wrote:
> Based on the description of error_setg(), the local variable err in
> qemu_init_subsystems() should be initialized to NULL.
>
> Fix: efd7ab22fb "vl: extract qemu_init_subsystems"
> Signed-off-by: Peng Liang <liangpeng10@huawei.com>
> ---
> The patch is generated by the following coccinelle script (thanks to
> Markus):
> @ r @
> identifier id;
> @@
> (
> static Error *id;
> |
> Error *id
> + = NULL
> ;
> )
> And exclude the modifications in softmmu/vl.c (which has fixed by
> Zhenzhong Duan already) and util/error.c (which are unnecessary).
>
> softmmu/runstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] runstate: Initialize Error * to NULL
2021-06-10 13:17 [PATCH] runstate: Initialize Error * to NULL Peng Liang
2021-06-10 13:25 ` Daniel P. Berrangé
@ 2021-06-10 13:41 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-06-10 13:41 UTC (permalink / raw)
To: Peng Liang, qemu-devel, qemu-stable
Cc: philmd, alejandro.j.jimenez, laurent, xiexiangyou, armbru, alex.bennee
On 10/06/21 15:17, Peng Liang wrote:
> Based on the description of error_setg(), the local variable err in
> qemu_init_subsystems() should be initialized to NULL.
>
> Fix: efd7ab22fb "vl: extract qemu_init_subsystems"
> Signed-off-by: Peng Liang <liangpeng10@huawei.com>
> ---
> The patch is generated by the following coccinelle script (thanks to
> Markus):
> @ r @
> identifier id;
> @@
> (
> static Error *id;
> |
> Error *id
> + = NULL
> ;
> )
> And exclude the modifications in softmmu/vl.c (which has fixed by
> Zhenzhong Duan already) and util/error.c (which are unnecessary).
>
> softmmu/runstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/softmmu/runstate.c b/softmmu/runstate.c
> index ce8977c6a29c..54713100c2ea 100644
> --- a/softmmu/runstate.c
> +++ b/softmmu/runstate.c
> @@ -746,7 +746,7 @@ static void qemu_run_exit_notifiers(void)
>
> void qemu_init_subsystems(void)
> {
> - Error *err;
> + Error *err = NULL;
>
> os_set_line_buffering();
>
>
Queued, thanks.
Cc: qemu-stable@nongnu.org
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-10 13:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 13:17 [PATCH] runstate: Initialize Error * to NULL Peng Liang
2021-06-10 13:25 ` Daniel P. Berrangé
2021-06-10 13:41 ` Paolo Bonzini
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.