nodeinfo: avoid uninitialized variable on error
Commit 8ba0a58f introduced a compiler warning that I hit during a run of ./autobuild.sh: ../../src/nodeinfo.c: In function 'nodeCapsInitNUMA': ../../src/nodeinfo.c:1853:43: error: 'nsiblings' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (virCapabilitiesAddHostNUMACell(caps, n, memory, ^ Sure enough, nsiblings starts uninitialized, and is set by a call to virNodeCapsGetSiblingInfo, but that function fails to assign through the pointer if virNumaGetDistances fails. * src/nodeinfo.c (nodeCapsInitNUMA): Initialize nsiblings. Signed-off-by: NEric Blake <eblake@redhat.com>
Showing
想要评论请 注册 或 登录