qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] runstate: Initialize Error * to NULL


From: Paolo Bonzini
Subject: Re: [PATCH] runstate: Initialize Error * to NULL
Date: Thu, 10 Jun 2021 15:41:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]