tools/libxc: Drop copy-in in xc_physinfo()

The first thing XEN_SYSCTL_physinfo does is zero op->u.physinfo.

Do not copy-in.  It's pointless, and most callers don't initialise their
xc_physinfo_t buffer to begin with.  Remove the redundant zeroing from the
remaining callers.

Spotted by Coverity.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Chen <Wei.Chen@arm.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
Andrew Cooper committed 2022-01-05 09:44:26 +00:00
1 parent af0c5430a8
commit 06cc1f886f
6 files changed
+5 -7

No files matched your search

+1 -1
View File
@@ -436,7 +436,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
*/
static unsigned int get_num_cpus(void)
{
xc_physinfo_t physinfo = { 0 };
xc_physinfo_t physinfo;
xc_interface *xc_handle = xc_interface_open(0,0,0);
int ret;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.