All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/libxc/xc_dom_arm: add missing variable initialization
@ 2017-08-19 14:21 Thomas Petazzoni
  2017-08-21  8:20 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-08-19 14:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Bernd Kuhls, Thomas Petazzoni

From: Bernd Kuhls <bernd.kuhls@t-online.de>

The variable domctl.u.address_size.size may remain uninitialized if
guest_type is not one of xen-3.0-aarch64 or xen-3.0-armv7l. And the
code precisely checks if this variable is still 0 to decide if the
guest type is supported or not.

This fixes the following build failure with gcc 7.x:

xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if ( domctl.u.address_size.size == 0 )

Patch originally taken from
https://www.mail-archive.com/xen-devel@lists.xen.org/msg109313.html.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 tools/libxc/xc_dom_arm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index e7d4bd0..e669fb0 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -223,6 +223,8 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
+    domctl.u.address_size.size = 0;
+
     for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;
-- 
2.9.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/libxc/xc_dom_arm: add missing variable initialization
  2017-08-19 14:21 [PATCH] tools/libxc/xc_dom_arm: add missing variable initialization Thomas Petazzoni
@ 2017-08-21  8:20 ` Wei Liu
  2017-09-14 21:45   ` Christopher Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2017-08-21  8:20 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Bernd Kuhls, Wei Liu, xen-devel

On Sat, Aug 19, 2017 at 04:21:42PM +0200, Thomas Petazzoni wrote:
> From: Bernd Kuhls <bernd.kuhls@t-online.de>
> 
> The variable domctl.u.address_size.size may remain uninitialized if
> guest_type is not one of xen-3.0-aarch64 or xen-3.0-armv7l. And the
> code precisely checks if this variable is still 0 to decide if the
> guest type is supported or not.
> 
> This fixes the following build failure with gcc 7.x:
> 
> xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if ( domctl.u.address_size.size == 0 )
> 
> Patch originally taken from
> https://www.mail-archive.com/xen-devel@lists.xen.org/msg109313.html.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/libxc/xc_dom_arm: add missing variable initialization
  2017-08-21  8:20 ` Wei Liu
@ 2017-09-14 21:45   ` Christopher Clark
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Clark @ 2017-09-14 21:45 UTC (permalink / raw)
  To: Wei Liu, xen-devel, Ian Jackson; +Cc: Thomas Petazzoni, Bernd Kuhls

On Mon, Aug 21, 2017 at 1:20 AM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Sat, Aug 19, 2017 at 04:21:42PM +0200, Thomas Petazzoni wrote:
>> From: Bernd Kuhls <bernd.kuhls@t-online.de>
>>
>> The variable domctl.u.address_size.size may remain uninitialized if
>> guest_type is not one of xen-3.0-aarch64 or xen-3.0-armv7l. And the
>> code precisely checks if this variable is still 0 to decide if the
>> guest type is supported or not.
>>
>> This fixes the following build failure with gcc 7.x:
>>
>> xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>>      if ( domctl.u.address_size.size == 0 )
>>
>> Patch originally taken from
>> https://www.mail-archive.com/xen-devel@lists.xen.org/msg109313.html.
>>
>> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Please can this patch be backported / cherry-picked into Xen 4.9.

commit 88bfbf90e35f1213f9967a97dee0b2039f9998a4

thanks

Christopher

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-14 21:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-19 14:21 [PATCH] tools/libxc/xc_dom_arm: add missing variable initialization Thomas Petazzoni
2017-08-21  8:20 ` Wei Liu
2017-09-14 21:45   ` Christopher Clark

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.